From fbe13810008a1cd8581b23dd09c2b455532239d5 Mon Sep 17 00:00:00 2001 From: ocahs9 Date: Tue, 9 Jul 2024 17:55:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20size,=20variant=20=EC=98=B5=EC=85=94?= =?UTF-8?q?=EB=84=90=EB=A1=9C=20=EB=84=A3=EC=9D=84=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/commons/button/Button.tsx | 12 +++++++++--- src/pages/MyRegisterdShow/MyRegisterdShow.tsx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/commons/button/Button.tsx b/src/components/commons/button/Button.tsx index 5eeb32c1..09f25fd0 100644 --- a/src/components/commons/button/Button.tsx +++ b/src/components/commons/button/Button.tsx @@ -6,14 +6,20 @@ export type ButtonVariantTypes = "primary" | "line" | "gray" | "blue"; //React.ButtonHTMLAttributes는 버튼 속성에 집중하긴 했지만, 제네릭 타입이다. export interface ButtonProps extends React.ButtonHTMLAttributes { - size: ButtonSizeTypes; - variant: ButtonVariantTypes; + size?: ButtonSizeTypes; + variant?: ButtonVariantTypes; children: ReactNode; //자식 노드(텍스트)를 받기 위해 필수. onClick?: React.MouseEventHandler; //MouseEvent와는 상이 } //disabled는 버튼의 기본 속성(따라서 위의 interface에서 명시되어 있지는 않다.) -const Button = ({ onClick, size, disabled, variant, children }: ButtonProps) => { +const Button = ({ + onClick, + size = "xlarge", + disabled, + variant = "primary", + children, +}: ButtonProps) => { return ( { navigate("/"); }; - const [isNothing, setIsNothing] = useState(false); + const [isNothing, setIsNothing] = useState(false); return ( <>