Last active
April 24, 2019 11:37
-
-
Save jyash97/1cfc9075edda43c5d792c772554cd9ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div className={container}> | |
<ReactiveList | |
pagination | |
componentId="results" | |
react={{ | |
and: ["search"] | |
}} | |
dataField="title.keyword" | |
> | |
{({ loading, data, error }) => { | |
if (loading) { | |
return <p>Loading...</p>; | |
} | |
if (error) { | |
return <p>Something Went Wrong!</p>; | |
} | |
if (data.length) { | |
return ( | |
<ReactiveList.ResultCardsWrapper> | |
{data.map(item => ( | |
<ResultCard key={item._id}> | |
<ResultCard.Image src={item.image} /> | |
<ResultCard.Title | |
dangerouslySetInnerHTML={{ | |
__html: item.original_title | |
}} | |
/> | |
</ResultCard> | |
))} | |
</ReactiveList.ResultCardsWrapper> | |
); | |
} else { | |
return <p>No Results Found</p>; | |
} | |
}} | |
</ReactiveList> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment