Skip to content

Commit

Permalink
Use new indexing display value
Browse files Browse the repository at this point in the history
  • Loading branch information
rallu committed Dec 7, 2023
1 parent 87485ee commit 921105e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ yarn-error.log*

# turbo
.turbo
.vercel
17 changes: 3 additions & 14 deletions composable-ui/src/components/klevu/klevu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,14 @@ function CustomGridRenderer(props: { products: KlevuRecord[] }) {
return (
<KlevuProductGrid>
{props.products.map((product) => {
// additionalDataToReturn is JSON have been indexed to display key on the product.
const originalProductJSON = JSON.parse(product.additionalDataToReturn).default
return (
<KlevuProduct key={product.id} product={product} isWrapper>
{/* Above: Components should be put inside KlevuProduct that has `isWrapper` prop defined. It means that it's empty shell. */}
{/* Below: Here you can use your own components */}
<CategoryProductCard
product={{
brand: product.brand,
description: product.description,
images: [
{
url: product.image,
alt: product.name,
},
],
name: product.name,
price: product.price,
sku: product.sku,
slug: product.url,
}}
product={originalProductJSON}
/>
</KlevuProduct>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export const ProductListingPage = ({
const [productsGridOption, setProductsGridOption] =
useState<CategoryPageProductGrid>('comfortable')

return null
/*
return (
<InstantSearchSSRProvider {...serverState}>
<InstantSearch searchClient={searchClient} indexName={ALGOLIA_INDEX_NAME}>
Expand Down Expand Up @@ -116,4 +118,5 @@ export const ProductListingPage = ({
</InstantSearch>
</InstantSearchSSRProvider>
)
*/
}

0 comments on commit 921105e

Please sign in to comment.