We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91131bc commit 4b2efe5Copy full SHA for 4b2efe5
client/src/components/common/Button/index.tsx
@@ -10,6 +10,7 @@ interface ButtonProps {
10
className?: string;
11
isDisable?: boolean;
12
color?: string;
13
+ onClick?: () => void;
14
}
15
16
function Button({
@@ -18,14 +19,21 @@ function Button({
18
19
className,
20
isDisable = false,
21
color,
22
+ onClick,
23
}: ButtonProps) {
24
+ const onClickBtn = () => {
25
+ if (onClick) onClick();
26
+ };
27
+
28
return (
29
<div
30
className={cx(style.button, className, { disable: isDisable })}
31
style={{ backgroundColor: color }}
32
>
33
{icon}
- <button disabled={isDisable}>{text}</button>
34
+ <button disabled={isDisable} onClick={onClickBtn}>
35
+ {text}
36
+ </button>
37
</div>
38
);
39
0 commit comments