Accept className
This commit is contained in:
1 parent
d2e95744b8
commit
e1fee3dd82
1 file changed
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import styles from "./button.module.css";
|
import styles from "./button.module.css";
|
||||||
|
|
||||||
const Button = ({ children, variant = "primary", onClick }) => {
|
const Button = ({ children, variant = "primary", onClick, className }) => {
|
||||||
let btnStyle;
|
let btnStyle;
|
||||||
|
|
||||||
if (variant === "primary") btnStyle = styles.primary;
|
if (variant === "primary") btnStyle = styles.primary;
|
||||||
@@ -8,7 +8,7 @@ const Button = ({ children, variant = "primary", onClick }) => {
|
|||||||
else if(variant === "transparent") btnStyle = styles.transparent;
|
else if(variant === "transparent") btnStyle = styles.transparent;
|
||||||
else btnStyle = styles.default;
|
else btnStyle = styles.default;
|
||||||
|
|
||||||
return <div className={`${styles.btn} ${btnStyle}`} onClick={onClick}>
|
return <div className={`${styles.btn} ${btnStyle} ${className}`} onClick={onClick}>
|
||||||
{children}
|
{children}
|
||||||
</div>;
|
</div>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user