Skip to content

Commit

Permalink
Refactor : added disabled prop to button component
Browse files Browse the repository at this point in the history
  • Loading branch information
j24m committed Oct 5, 2023
1 parent 3d3fe84 commit c1c59ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ interface ButtonProps {
className: string;
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
children: React.ReactNode;
disabled?: boolean;
}

const Button: React.FC<ButtonProps> = ({ type, className, onClick, children }) => {
const Button: React.FC<ButtonProps> = ({ type, className, onClick, children, disabled }) => {
return (
<button type={type} className={className} onClick={onClick}>
<button type={type} className={className} onClick={onClick} disabled={disabled}>
{children}
</button>
);
Expand Down

0 comments on commit c1c59ff

Please sign in to comment.