mirror of
https://github.com/vercel/commerce.git
synced 2025-08-13 04:11:23 +00:00
.github
.vscode
app
components
cart
actions.ts
add-to-cart.tsx
close-cart.tsx
delete-item-button.tsx
edit-item-quantity-button.tsx
index.tsx
modal.tsx
open-cart.tsx
grid
icons
layout
product
carousel.tsx
label.tsx
loading-dots.tsx
logo-square.tsx
opengraph-image.tsx
price.tsx
prose.tsx
constants
fonts
lib
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
yarn.lock
25 lines
728 B
TypeScript
25 lines
728 B
TypeScript
import { ShoppingCartIcon } from '@heroicons/react/24/outline';
|
|
import clsx from 'clsx';
|
|
|
|
export default function OpenCart({
|
|
className,
|
|
quantity
|
|
}: {
|
|
className?: string;
|
|
quantity?: number;
|
|
}) {
|
|
return (
|
|
<div className="relative flex h-11 w-11 items-center justify-center rounded-md border border-neutral-200 text-black transition-colors dark:border-neutral-700 dark:text-white">
|
|
<ShoppingCartIcon
|
|
className={clsx('h-4 transition-all ease-in-out hover:scale-110 ', className)}
|
|
/>
|
|
|
|
{quantity ? (
|
|
<div className="absolute right-0 top-0 -mr-2 -mt-2 h-4 w-4 rounded bg-blue-600 text-[11px] font-medium text-white">
|
|
{quantity}
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
);
|
|
}
|