Skip to content

Commit b3dc436

Browse files
author
crzypatchwork
committed
return
1 parent 2665f24 commit b3dc436

File tree

1 file changed

+68
-68
lines changed

1 file changed

+68
-68
lines changed

src/pages/search/index.js

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -726,76 +726,76 @@ export class Search extends Component {
726726
console.log(this.state.feed)
727727
}
728728

729-
hoverState = (bool) => this.setState({ mouse: bool })
730-
731-
select = (id) => this.setState({ select: [...this.state.select, id] })
732-
733-
loadMore = () => {
734-
this.setState({ offset: this.state.offset + 15 })
735-
this.update(this.state.select, false)
736-
}
737-
738-
handleKey = (e) => {
739-
console.log(this.state.search)
740-
if (e.key == 'Enter') this.search(this.state.search)
741-
}
742-
743-
render() {
744-
745-
return (
746-
<Page>
747-
<Container>
748-
<Padding>
749-
<Input
750-
type="text"
751-
name="search"
752-
onChange={this.handleChange}
753-
label="search objkt id, artists, tags (press Enter)"
754-
placeholder="search objkt id, artists, tags (press Enter)"
755-
onKeyPress={this.handleKey}
756-
/>
757-
{
758-
<div style={{ marginTop: '15px' }}>
759-
{this.state.tags.map(e => <a className='tag' href='#' onClick={() => {
760-
this.update(e.value, true)
761-
}}>{e.value} </a>)}
762-
</div>
763-
}
764-
{
765-
(this.state.subjkt.length > 0) && (this.state.search !== "") ?
766-
<div style={{ maxHeight: '200px', overflow: 'scroll' }}>
767-
{
768-
this.state.subjkt.map(e => <div style={{ marginTop: '10px' }}><a href={`/${e.name}`}>{e.name}</a> {e.metadata.description}</div>)
769-
}
770-
</div>
771-
:
772-
undefined
773-
}
774-
</Padding>
775-
</Container>
776-
<Container xlarge>
729+
hoverState = (bool) => this.setState({ mouse: bool })
730+
731+
select = (id) => this.setState({ select: [...this.state.select, id] })
732+
733+
loadMore = () => {
734+
this.setState({ offset: this.state.offset + 15 })
735+
this.update(this.state.select, false)
736+
}
737+
738+
handleKey = (e) => {
739+
console.log(this.state.search)
740+
if (e.key == 'Enter') this.search(this.state.search)
741+
}
742+
743+
render() {
744+
745+
return (
746+
<Page>
747+
<Container>
748+
<Padding>
749+
<Input
750+
type="text"
751+
name="search"
752+
onChange={this.handleChange}
753+
label="search for objkt id, artists, tags ↵"
754+
placeholder="search for objkt id, artists, tags ↵"
755+
onKeyPress={this.handleKey}
756+
/>
757+
{
758+
<div style={{ marginTop: '15px' }}>
759+
{this.state.tags.map(e => <a className='tag' href='#' onClick={() => {
760+
this.update(e.value, true)
761+
}}>{e.value} </a>)}
762+
</div>
763+
}
777764
{
778-
this.state.feed.length > 0 ?
779-
<InfiniteScroll
780-
dataLength={this.state.feed.length}
781-
next={this.loadMore}
782-
hasMore={this.state.hasMore}
783-
loader={undefined}
784-
endMessage={undefined}
785-
>
786-
<Container>
787-
<Padding>
788-
{this.state.feed.map((item, index) => (
789-
<FeedItem key={`${item.id}-${index}`} {...item} />
790-
))}
791-
</Padding>
792-
</Container>
793-
</InfiniteScroll>
765+
(this.state.subjkt.length > 0) && (this.state.search !== "") ?
766+
<div style={{ maxHeight: '200px', overflow: 'scroll' }}>
767+
{
768+
this.state.subjkt.map(e => <div style={{ marginTop: '10px' }}><a href={`/${e.name}`}>{e.name}</a> {e.metadata.description}</div>)
769+
}
770+
</div>
794771
:
795772
undefined
796773
}
797-
</Container>
798-
</Page>
799-
)
800-
}
774+
</Padding>
775+
</Container>
776+
<Container xlarge>
777+
{
778+
this.state.feed.length > 0 ?
779+
<InfiniteScroll
780+
dataLength={this.state.feed.length}
781+
next={this.loadMore}
782+
hasMore={this.state.hasMore}
783+
loader={undefined}
784+
endMessage={undefined}
785+
>
786+
<Container>
787+
<Padding>
788+
{this.state.feed.map((item, index) => (
789+
<FeedItem key={`${item.id}-${index}`} {...item} />
790+
))}
791+
</Padding>
792+
</Container>
793+
</InfiniteScroll>
794+
:
795+
undefined
796+
}
797+
</Container>
798+
</Page>
799+
)
801800
}
801+
}

0 commit comments

Comments
 (0)