-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Chigrin
authored
Feb 6, 2022
1 parent
e51d8c5
commit ccdc8d2
Showing
6 changed files
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.13.2 |
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import clsx from "clsx"; | ||
|
||
export const Button: React.FC<React.ComponentPropsWithRef<"button">> = ( | ||
props | ||
) => <button {...props} className={clsx(props.className, "nes-btn")} />; | ||
const variants = { | ||
primary: "is-primary", | ||
success: "is-success", | ||
warning: "is-warning", | ||
error: "is-error", | ||
} as const; | ||
|
||
export const Button: React.FC< | ||
React.ComponentPropsWithRef<"button"> & { variant?: keyof typeof variants } | ||
> = ({ variant, ...props }) => ( | ||
<button | ||
{...props} | ||
className={clsx( | ||
props.className, | ||
"nes-btn", | ||
props.disabled && "is-disabled", | ||
variant && variants[variant] | ||
)} | ||
/> | ||
); |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters