From bc6e2adf86a3546e0ad168066a10376eff371597 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Sat, 5 Jun 2021 15:13:38 -0300 Subject: [PATCH] Fix for slim tags --- .../ProductCard/ProductCard.module.css | 6 +++++- components/ui/Marquee/Marquee.tsx | 21 +++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/components/product/ProductCard/ProductCard.module.css b/components/product/ProductCard/ProductCard.module.css index cad429c70..dbf81cc17 100644 --- a/components/product/ProductCard/ProductCard.module.css +++ b/components/product/ProductCard/ProductCard.module.css @@ -102,5 +102,9 @@ } .slim .tag { - @apply bg-secondary text-secondary inline-block p-3 font-bold text-xl break-words; + @apply bg-accent-9 text-accent-0 inline-block p-3 font-bold text-xl break-words; +} + +.root:global(.secondary) .tag { + @apply bg-accent-0 text-accent-9; } diff --git a/components/ui/Marquee/Marquee.tsx b/components/ui/Marquee/Marquee.tsx index a45f831aa..70a05bc01 100644 --- a/components/ui/Marquee/Marquee.tsx +++ b/components/ui/Marquee/Marquee.tsx @@ -1,6 +1,6 @@ import cn from 'classnames' import s from './Marquee.module.css' -import { FC, ReactNode, Component, Children, isValidElement } from 'react' +import { FC, ReactNode, Component, Children } from 'react' import Ticker from 'react-ticker' interface MarqueeProps { @@ -28,18 +28,13 @@ const Marquee: FC = ({ {() => (
- {Children.map(children, (child) => { - if (isValidElement(child)) { - return { - ...child, - props: { - ...child.props, - className: cn(child.props.className, `${variant}`), - }, - } - } - return child - })} + {Children.map(children, (child) => ({ + ...child, + props: { + ...child.props, + className: cn(child.props.className, `${variant}`), + }, + }))}
)}