mirror of
https://github.com/vercel/commerce.git
synced 2025-08-23 01:01:22 +00:00
assets
components
cart
core
icon
product
ui
Button
Container
Grid
Hero
Link
LoadingDots
Logo
Marquee
Marquee.module.css
Marquee.tsx
index.ts
Sidebar
Skeleton
README.md
context.tsx
index.ts
types.ts
wishlist
config
lib
pages
public
utils
.gitignore
.prettierignore
README.md
codegen.json
global.d.ts
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
42 lines
923 B
TypeScript
42 lines
923 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 M: FC<Props> = ({ className = '', children, variant = 'primary' }) => {
|
|
const rootClassName = cn(
|
|
s.root,
|
|
{
|
|
[s.primary]: variant === 'primary',
|
|
[s.secondary]: variant === 'secondary',
|
|
},
|
|
className
|
|
)
|
|
|
|
// return (
|
|
// <div className={rootClassName}>
|
|
// <div className={s.container}>
|
|
// {items.map((p: any) => (
|
|
// <Component {...p} />
|
|
// ))}
|
|
// </div>
|
|
// </div>
|
|
// )
|
|
|
|
return (
|
|
<div className={rootClassName}>
|
|
<Ticker offset={80}>
|
|
{({ index }) => <div className={s.container}>{children}</div>}
|
|
</Ticker>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default M
|