Fix for slim tags

This commit is contained in:
Bel Curcio 2021-06-05 15:13:38 -03:00
parent 813b1a86fd
commit bc6e2adf86
2 changed files with 13 additions and 14 deletions

View File

@ -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;
}

View File

@ -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<MarqueeProps> = ({
<Ticker offset={80}>
{() => (
<div className={s.container}>
{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}`),
},
}))}
</div>
)}
</Ticker>