mirror of
https://github.com/vercel/commerce.git
synced 2025-03-27 15:55:54 +00:00
* Remove duplicated css rules. (#185) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicated css rules. Fix invalid JSX props. Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Fix the body scroll when the sidebar is open (#184) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Fix the body scroll when the sidebar is open Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicate class in the I18nWidget comp (#183) * Fix typo in the Marquee component (#176) Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * Remove duplicate class name in the I18nWidget comp This PR removes a duplicate class name in the I18nWidget component. Co-authored-by: Hugo Lopes <hugo.rodrigues.lopes@gmail.com> Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> * add horizontal margin to pages when mobile screen (#180) * Add cart item options like color and size (#177) Co-authored-by: hlopes <hugo.lopes@present-technologies.com> * Changes Co-authored-by: Hugo Lopes <hugo.rodrigues.lopes@gmail.com> Co-authored-by: Hugo Lopes <hugo.lopes@present-technologies.com> Co-authored-by: Jamie Isaksen <jamie@jamie.no> Co-authored-by: Vinicius Zucatti <51221635+vczb@users.noreply.github.com>
36 lines
718 B
TypeScript
36 lines
718 B
TypeScript
import cn from 'classnames'
|
|
import s from './Marquee.module.css'
|
|
import { FC, ReactNode, Component } from 'react'
|
|
import Ticker from 'react-ticker'
|
|
|
|
interface Props {
|
|
className?: string
|
|
children?: ReactNode[] | Component[] | any[]
|
|
variant?: 'primary' | 'secondary'
|
|
}
|
|
|
|
const Marquee: FC<Props> = ({
|
|
className = '',
|
|
children,
|
|
variant = 'primary',
|
|
}) => {
|
|
const rootClassName = cn(
|
|
s.root,
|
|
{
|
|
[s.primary]: variant === 'primary',
|
|
[s.secondary]: variant === 'secondary',
|
|
},
|
|
className
|
|
)
|
|
|
|
return (
|
|
<div className={rootClassName}>
|
|
<Ticker offset={80}>
|
|
{() => <div className={s.container}>{children}</div>}
|
|
</Ticker>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Marquee
|