feat: ui components
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import s from './button.module.scss';
|
||||
import { FunctionComponent, HTMLAttributes, ReactNode, SVGProps } from 'react';
|
||||
import {
|
||||
ButtonHTMLAttributes,
|
||||
DetailedHTMLProps,
|
||||
FunctionComponent,
|
||||
ReactNode,
|
||||
SVGProps,
|
||||
} from 'react';
|
||||
import { clsx } from 'clsx';
|
||||
|
||||
type ButtonProps = {
|
||||
@@ -9,7 +15,11 @@ type ButtonProps = {
|
||||
Icon?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
||||
onClick?: () => void;
|
||||
variant?: 'default' | 'orange' | 'ghost';
|
||||
} & HTMLAttributes<HTMLButtonElement>;
|
||||
fullWidth?: boolean;
|
||||
} & DetailedHTMLProps<
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
>;
|
||||
|
||||
export default function Button({
|
||||
className,
|
||||
@@ -18,6 +28,7 @@ export default function Button({
|
||||
Icon,
|
||||
disabled,
|
||||
variant = 'default',
|
||||
fullWidth = false,
|
||||
...props
|
||||
}: ButtonProps) {
|
||||
return (
|
||||
@@ -26,6 +37,7 @@ export default function Button({
|
||||
s.Button,
|
||||
disabled && s.Button_disabled,
|
||||
s['Button_' + variant],
|
||||
fullWidth && s.Button_fullWidth,
|
||||
className,
|
||||
)}
|
||||
onClick={onClick}
|
||||
|
||||
Reference in New Issue
Block a user