Last active
February 15, 2022 12:58
-
-
Save cborodescu/b130da80aa87343fe032206f0a023be1 to your computer and use it in GitHub Desktop.
User Intent Graph - Search App
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
function SearchListing({ results }) { | |
const { affinities } = useAffinities(); | |
const categoryAffinity = affinities.find((x) => (x.name = "category")); | |
const brandAffinity = affinities.find((x) => (x.name = "brand")); | |
const colorAffinity = affinities.find((x) => (x.name = "color")); | |
return ( | |
// Display results that match category, brand and color affinities | |
); | |
} | |
function App({ api }) { | |
const results = api.getResults(); | |
return ( | |
<UserIntentGraphProvider | |
userIntentGraphClient={userIntentGraphClient} | |
user={api.getUser()} | |
> | |
<SearchListing results={results} /> | |
</UserIntentGraphProvider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment