Skip to content

Commit

Permalink
fix: type and react hook issues in carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorreem committed Dec 11, 2024
1 parent 210269d commit 77f1902
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/storyblok/StoryblokCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const CustomDots = () => {
<Box>
<Box display="flex" gap={1} alignContent="center" width="100%">
{[...Array(totalPages)].map((_, index) => (
<Box>
<Box key={index}>
<button
style={{
borderRadius: 50,
Expand Down Expand Up @@ -115,12 +115,12 @@ const StoryblokCarousel = (props: StoryblokCarouselProps) => {
} = props;

const siteTheme = useTheme();
const isMobileScreen = useMediaQuery(siteTheme.breakpoints.down('sm'));

const getSlideWidth = () => {
if (useMediaQuery(siteTheme.breakpoints.down('sm'))) {
if (isMobileScreen) {
return numberSlidesToWidthMap[number_mobile_slides || 1];
}
return numberSlidesToWidthMap[number_desktop_slides || 1];
};

return (
Expand Down

0 comments on commit 77f1902

Please sign in to comment.