Skip to content

Commit

Permalink
fix: remove cva
Browse files Browse the repository at this point in the history
  • Loading branch information
yamato0211 committed Nov 12, 2023
1 parent b361150 commit ec74216
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/ui/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import type { ButtonHTMLAttributes, ReactNode } from "react";
import { forwardRef } from "react"

import { Slot } from "@radix-ui/react-slot"
import { cva } from "class-variance-authority"

import type { VariantProps } from "class-variance-authority"
import { buttonVariants } from "../Button";

import { cn } from "@/libs/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
)

export interface ButtonProps
extends ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
const buttonStyles = "inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"

export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
asChild?: boolean
}

Expand All @@ -35,7 +31,7 @@ const IconButton = forwardRef<HTMLButtonElement, ButtonProps & Props>(
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ className }))}
className={cn(buttonStyles, className)}
ref={ref}
{...props}
>
Expand Down

0 comments on commit ec74216

Please sign in to comment.