Styling updates

This commit is contained in:
Bel Curcio 2021-06-05 14:11:43 -03:00
parent 97984c3691
commit 813b1a86fd
3 changed files with 22 additions and 5 deletions

View File

@ -100,3 +100,7 @@
.slim { .slim {
@apply bg-transparent relative overflow-hidden box-border; @apply bg-transparent relative overflow-hidden box-border;
} }
.slim .tag {
@apply bg-secondary text-secondary inline-block p-3 font-bold text-xl break-words;
}

View File

@ -35,9 +35,7 @@ const ProductCard: FC<Props> = ({
{variant === 'slim' && ( {variant === 'slim' && (
<> <>
<div className="absolute inset-0 flex items-center justify-end mr-8 z-20"> <div className="absolute inset-0 flex items-center justify-end mr-8 z-20">
<span className="bg-accent-0 text-accent-9 inline-block p-3 font-bold text-xl break-words"> <span className={s.tag}>{product.name}</span>
{product.name}
</span>
</div> </div>
{product?.images && ( {product?.images && (
<Image <Image

View File

@ -1,6 +1,6 @@
import cn from 'classnames' import cn from 'classnames'
import s from './Marquee.module.css' import s from './Marquee.module.css'
import { FC, ReactNode, Component } from 'react' import { FC, ReactNode, Component, Children, isValidElement } from 'react'
import Ticker from 'react-ticker' import Ticker from 'react-ticker'
interface MarqueeProps { interface MarqueeProps {
@ -26,7 +26,22 @@ const Marquee: FC<MarqueeProps> = ({
return ( return (
<div className={rootClassName}> <div className={rootClassName}>
<Ticker offset={80}> <Ticker offset={80}>
{() => <div className={s.container}>{children}</div>} {() => (
<div className={s.container}>
{Children.map(children, (child) => {
if (isValidElement(child)) {
return {
...child,
props: {
...child.props,
className: cn(child.props.className, `${variant}`),
},
}
}
return child
})}
</div>
)}
</Ticker> </Ticker>
</div> </div>
) )