Skip to content

Commit

Permalink
Button: variant style updated, variance props issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nirnejak committed Jul 1, 2024
1 parent 2a92d8b commit 09156d6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions components/atoms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import classNames from "@/utils/classNames"
const buttonVariants = cva("rounded-md", {
variants: {
variant: {
primary: "bg-blue-500",
secondary: "bg-gray-500",
primary: "bg-white",
secondary: "bg-gray-400",
},
size: {
sm: "px-2 py-1",
md: "px-3 py-2",
lg: "px-4 py-3",
sm: "px-5 py-1.5 text-sm",
md: "px-6 py-2",
lg: "px-8 py-3 text-lg",
},
defaultVariants: {
variant: "primary",
variant: "secondary",
size: "md",
},
},
Expand All @@ -28,14 +28,17 @@ export interface Props
asChild?: boolean
}

const Button: React.FC<Props> = ({ children, className, ...props }) => {
const Button: React.FC<Props> = ({
children,
className,
variant,
size,
...props
}) => {
return (
<button
{...props}
className={classNames(
buttonVariants({ variant: "primary", size: "md" }),
className
)}
className={classNames(buttonVariants({ variant, size }), className)}
>
{children}
</button>
Expand Down

0 comments on commit 09156d6

Please sign in to comment.