From 715d9c48450804de0c23faa365b8717015947db8 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Sun, 17 Dec 2023 12:08:56 +0100 Subject: [PATCH] fix: style corrections for mobile --- components/custom/card.tsx | 31 +++++++++++++++++++++++++++---- package.json | 1 + yarn.lock | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/components/custom/card.tsx b/components/custom/card.tsx index 33f72c4..67fd59c 100644 --- a/components/custom/card.tsx +++ b/components/custom/card.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; +import { useMediaQuery } from 'react-responsive'; import { Card, CardContent, @@ -24,15 +25,37 @@ export const CustomCard = ({ style, footer = true }: CustomCardProps) => { + const isMobile = useMediaQuery({ query: '(max-width: 767px)' }); + + if (isMobile) { + console.log(isMobile); + return ( + + + {title} + {description} + + + {content} + + {footer && ( + +