Skip to content

Commit

Permalink
style: button element prop 확장해서 넘겨주는 방식으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 committed Oct 17, 2024
1 parent ad2d2ea commit 86113b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ import {setDarker, setLighter} from '@components/Design/utils/colors';

import {Text, useTheme} from '@components/Design';

interface Props {
type KeypadProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
value: string;
ariaLabel?: string;
onClick: () => void;
disabled?: boolean;
}
};

export function Keypad({value, ariaLabel, onClick, disabled = false}: Props) {
export function Keypad({value, ...restButtonProps}: KeypadProps) {
const {theme} = useTheme();

return (
<button
aria-label={ariaLabel}
{...restButtonProps}
css={css`
display: flex;
justify-content: center;
Expand All @@ -35,8 +33,6 @@ export function Keypad({value, ariaLabel, onClick, disabled = false}: Props) {
}
}
`}
onClick={onClick}
disabled={disabled}
>
<Text size="title">{value}</Text>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function NumberKeyboard({type, maxNumber, initialValue, onChange}
<Keypad
key={keypad}
value={keypad}
ariaLabel={ariaLabel}
aria-label={ariaLabel}
disabled={keypad === ''}
onClick={keypad === '<-' ? onClickDelete : () => onClickKeypad(keypad)}
/>
Expand Down

0 comments on commit 86113b9

Please sign in to comment.