1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-29 13:11:22 +00:00
Files
.github
.vscode
packages
site
assets
components
auth
cart
checkout
common
About
Avatar
Category
FeatureBar
FeatureBar.module.css
FeatureBar.tsx
index.ts
Footer
Head
HomeAllProductsGrid
HomePage
I18nWidget
Layout
Navbar
News
Room
SEO
Searchbar
SidebarLayout
UserNav
index.ts
icons
product
ui
wishlist
search.tsx
config
lib
pages
public
static_data
workers
.env.template
.eslintrc
.gitignore
.npmrc
.prettierignore
.prettierrc
commerce-config.js
commerce.config.json
global.d.ts
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
.editorconfig
.gitignore
.prettierignore
.prettierrc
README.md
license.md
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
turbo.json
commerce/site/components/common/FeatureBar/FeatureBar.tsx
Dom Sip c11b1ca868 refactor: SOL-122: replace classnames with clsx ()
refactor: SOL-122: replace classnames with clsx
2022-02-08 11:53:32 -05:00

40 lines
757 B
TypeScript

import cn from 'clsx'
import s from './FeatureBar.module.css'
interface FeatureBarProps {
className?: string
title: string
description?: string
hide?: boolean
action?: React.ReactNode
}
const FeatureBar: React.FC<FeatureBarProps> = ({
title,
description,
className,
action,
hide,
}) => {
const rootClassName = cn(
s.root,
{
transform: true,
'translate-y-0 opacity-100': !hide,
'translate-y-full opacity-0': hide,
},
className
)
return (
<div className={rootClassName}>
<span className="block md:inline">{title}</span>
<span className="block mb-6 md:inline md:mb-0 md:ml-2">
{description}
</span>
{action && action}
</div>
)
}
export default FeatureBar