Skip to content

Commit

Permalink
Updated button component
Browse files Browse the repository at this point in the history
  • Loading branch information
martiserra99 committed Feb 11, 2025
1 parent 29d4051 commit 7dbbd9e
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions apps/react/src/components/user-interface/button.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
import type { ReactNode } from "react";
import type { ComponentPropsWithoutRef } from "react";

import { cn } from "../../utils";

interface ButtonProps {
type?: "button" | "submit";
children: ReactNode;
onClick?: () => void;
disabled?: boolean;
}

export default function Button({
type = "submit",
children,
disabled,
onClick,
}: ButtonProps) {
className,
...props
}: ComponentPropsWithoutRef<"button">) {
return (
<button
data-cy="button"
type={type}
className={cn(
"block w-full rounded-full bg-indigo-500 px-6 py-4 text-base text-white hover:bg-indigo-400",
"focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-black",
"disabled:bg-indigo-500 disabled:opacity-60"
"disabled:bg-indigo-500 disabled:opacity-60",
className
)}
disabled={disabled}
onClick={onClick}
>
{children}
</button>
{...props}
/>
);
}

0 comments on commit 7dbbd9e

Please sign in to comment.