Skip to content

Commit

Permalink
removing the recommendedProducts from main namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsbajorics committed May 6, 2024
1 parent 5403b54 commit 6d9851a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/components/RecommendedProducts.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { Suspense } from 'react'
import { ProductCard, TypographyTitle } from './Components'
import { Await } from '@remix-run/react'
import { Await, useLoaderData } from '@remix-run/react'
import { RecommendedProductsGrid } from './Layout'

/**
* @param {{
* products: Promise<RecommendedProductsQuery>;
* }}
*/
export function RecommendedProducts({ products }) {
export function RecommendedProducts() {
const { recommendedProducts } = useLoaderData()
return (
<div className='recommended-products'>
<TypographyTitle level={2}>
Featured Products
</TypographyTitle>
<RecommendedProductsGrid>
{products.map((product, i) => (
{recommendedProducts.map((product, i) => (
<ProductCard
key={product.id}
id={product.id}
Expand Down
2 changes: 0 additions & 2 deletions app/routes/_index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const TestimonialCard = ({
export default function LandingPage() {
const { testimonials } = useLoaderData()
const { featuredCollections } = useLoaderData()
const { recommendedProducts } = useLoaderData()

return (
<Column>
Expand Down Expand Up @@ -428,7 +427,6 @@ export default function LandingPage() {
style={{ width: 1440, height: 805.5 }}
>
<RecommendedProducts
products={recommendedProducts}
style={{
width: 441,
height: 806,
Expand Down
1 change: 0 additions & 1 deletion app/routes/trippy-trails-template.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export async function loader({ params, context }) {
export default function LandingPage() {
const { testimonials } = useLoaderData()
const { featuredCollections } = useLoaderData()
const { recommendedProducts } = useLoaderData()

return (
<Column>
Expand Down

0 comments on commit 6d9851a

Please sign in to comment.