Skip to content

Commit

Permalink
Split button into two sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
gndelia committed Feb 15, 2024
1 parent 71d5f1a commit 9d0c000
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ui-common/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const sizes = {
large: 'h-14',
small: 'h-10',
} as const

type Props = React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement
>
> & { size?: keyof typeof sizes }

export const Button = ({ disabled, ...props }: Props) => (
export const Button = ({ disabled, size = 'large', ...props }: Props) => (
<button
className={`h-14 w-full cursor-pointer rounded-xl bg-black text-base text-white ${
className={`${
sizes[size]
} w-full cursor-pointer rounded-xl bg-black text-base text-white ${
disabled
? 'cursor-not-allowed bg-opacity-60'
: 'cursor-pointer hover:bg-opacity-80'
Expand Down

0 comments on commit 9d0c000

Please sign in to comment.