Created
February 28, 2021 20:42
-
-
Save Mazuh/add18ca66d2d4cc8e8fd6e498a9f6716 to your computer and use it in GitHub Desktop.
Revisions
-
Mazuh created this gist
Feb 28, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ function getBgColor(variant) { if (variant === "primary") { return "blue"; } if (variant === "danger") { return "red"; } if (variant === "warning") { return "yellow"; } return "none"; } function Button({ variant = "primary", ...props }) { return <button style={{ background: getBgColor(variant) }} {...props} />; }