Skip to content

Commit

Permalink
fix: height of items in best-selling items resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
pooriaset committed May 4, 2024
1 parent 4cb2f17 commit d9879c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/BestSellingProducts/BestSellingProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { GetAllProductsQuery } from '@/graphql/types/graphql';
import { Card, CardContent, CardHeader } from '@mui/material';
import { useTranslations } from 'next-intl';
import { FC } from 'react';
import Slider from './components/Slider';
import { useTranslations } from 'next-intl';

export interface BestSellingProductsProps {
items?: NonNullable<GetAllProductsQuery['products']>['nodes'];
Expand Down
10 changes: 9 additions & 1 deletion src/components/BestSellingProducts/components/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ const Slider: FC<SliderProps> = ({ items }) => {
},
}}
spaceBetween={16}
style={{
paddingBottom: 2,
}}
>
{items?.map((product) => {
if (product.__typename === 'VariableProduct') {
return (
<SwiperSlide key={product.databaseId}>
<SwiperSlide
key={product.databaseId}
style={{
height: 'auto',
}}
>
<VariableProductItem data={product} />
</SwiperSlide>
);
Expand Down

0 comments on commit d9879c1

Please sign in to comment.