-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: (#15) 버튼 컴포넌트 프롭스가 버튼 엘리먼트 상속 받도록 수정
- Loading branch information
Showing
4 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
|
||
import * as S from './style'; | ||
|
||
interface HeaderTextButtonProps { | ||
interface HeaderTextButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
children: string; | ||
clickEvent: () => void; | ||
} | ||
|
||
/* 헤더에 포함되어 취소, 확인, 신고 등 사용될 버튼 | ||
* props로 s/m/l 크기를 받음 | ||
*/ | ||
export default function HeaderTextButton({ children, clickEvent }: HeaderTextButtonProps) { | ||
return <S.Button onClick={clickEvent}>{children}</S.Button>; | ||
export default function HeaderTextButton({ children, ...rest }: HeaderTextButtonProps) { | ||
return <S.Button {...rest}>{children}</S.Button>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters