Skip to content

Commit

Permalink
Refactor: ModalButton 비활성화 속성 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyoung-min authored Feb 2, 2024
1 parent 801369a commit a3eaf2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Modal/ModalButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ interface ModalButtonProps {
children: ReactNode;
onCancel: MouseEventHandler<HTMLButtonElement>;
onClick: MouseEventHandler<HTMLButtonElement>;
isDisabled?: boolean;
}

export default function ModalButton({ children, onCancel, onClick }: ModalButtonProps) {
export default function ModalButton({ children, onCancel, onClick, isDisabled = false }: ModalButtonProps) {
return (
<div className={styles.buttonContainer}>
<button type="button" className={styles.secondaryButton} onClick={onCancel}>
취소
</button>
<button type="button" className={styles.primaryButton} onClick={onClick}>
<button type="button" className={isDisabled ? styles.disabledButton : styles.primaryButton} onClick={onClick} disabled={isDisabled}>
{children}
</button>
</div>
Expand Down

0 comments on commit a3eaf2a

Please sign in to comment.