diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 2bb3e149a..847cea12e 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -1,12 +1,12 @@ import cn from 'classnames' import s from './ProductCard.module.css' -import { FC } from 'react' +import { FC, ReactNode, Component } from 'react' import { Heart } from '@components/icon' import Link from 'next/link' interface Props { className?: string - children?: any + children?: ReactNode[] | Component[] | any[] node: ProductData variant?: 'slim' } diff --git a/components/ui/Grid/Grid.tsx b/components/ui/Grid/Grid.tsx index 530c7ed8b..8ca247609 100644 --- a/components/ui/Grid/Grid.tsx +++ b/components/ui/Grid/Grid.tsx @@ -4,20 +4,15 @@ import s from './Grid.module.css' interface Props { className?: string - children?: any - items: [any] | any + children?: ReactNode[] | Component[] | any[] layout?: 'A' | 'B' | 'C' | 'D' | 'normal' - wrapper?: ReactNode | Component | any variant?: 'default' | 'filled' } -const DefaultWrapper: FC = ({ children }) =>
{children}
// DEFAULT ITEMS WRAPPER - const Grid: FC = ({ - items = [], className, layout = 'A', - wrapper: Component = DefaultWrapper, + children, variant = 'default', }) => { const rootClassName = cn( @@ -33,13 +28,7 @@ const Grid: FC = ({ }, className ) - return ( -
- {items.map((data: any, i: any) => ( - - ))} -
- ) + return
{children}
} export default Grid diff --git a/components/ui/Marquee/Marquee.tsx b/components/ui/Marquee/Marquee.tsx index cc4837c09..f341cd8cf 100644 --- a/components/ui/Marquee/Marquee.tsx +++ b/components/ui/Marquee/Marquee.tsx @@ -1,24 +1,15 @@ import cn from 'classnames' import s from './Marquee.module.css' -import { FC } from 'react' +import { FC, ReactNode, Component } from 'react' import Ticker from 'react-ticker' interface Props { className?: string - children?: any - items: any[] - wrapper?: React.Component | any + children?: ReactNode[] | Component[] | any[] variant?: 'primary' | 'secondary' } -const DefaultWrapper: FC = ({ children }) =>
{children}
// DEFAULT PRODUCT WRAPPER - -const M: FC = ({ - className = '', - items, - wrapper: Component = DefaultWrapper, - variant = 'primary', -}) => { +const M: FC = ({ className = '', children, variant = 'primary' }) => { const rootClassName = cn( s.root, { @@ -41,13 +32,7 @@ const M: FC = ({ return (
- {({ index }) => ( -
- {items.map((p: any, i: any) => ( - - ))} -
- )} + {({ index }) =>
{children}
}
) diff --git a/pages/index.tsx b/pages/index.tsx index 39a1d0aa2..04b3e9ef5 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -23,11 +23,16 @@ export default function Home({ }: InferGetStaticPropsType) { return (
- - } - /> + + {products.slice(0, 3).map((p: any) => ( + + ))} + + + {products.slice(0, 3).map((p: any) => ( + + ))} + - - } - /> + + {products.slice(3, 6).map((p: any) => ( + + ))} + + + {products.slice(0, 3).map((p: any) => ( + + ))} +
    @@ -68,15 +77,11 @@ export default function Home({
- + + {products.map((p: any) => ( + + ))} +