Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 878a2a7

Browse files
authoredJul 5, 2021
Merge pull request #62 from MadOPcode/dev
Modal component, payment cancelling, processing errors in popovers and other improvements
2 parents 9e469c4 + d2d1a1c commit 878a2a7

File tree

52 files changed

+1246
-343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1246
-343
lines changed
 
Lines changed: 30 additions & 0 deletions
Loading

‎src/components/Button/index.jsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import styles from "./styles.module.scss";
99
* @param {Object} props component properties
1010
* @param {Object} props.children button text
1111
* @param {string} [props.className] class name added to root element
12-
* @param {'primary'|'primary-dark'|'primary-light'} [props.color] button color
12+
* @param {'primary'|'primary-dark'|'primary-light'|'error'|'warning'} [props.color]
13+
* button color
1314
* @param {boolean} [props.isDisabled] if button is disabled
1415
* @param {boolean} [props.isSelected] if button is selected
1516
* @param {string} [props.name] button name
16-
* @param {(e: any) => void} props.onClick function called when button is clicked
17+
* @param {(e: any) => void} [props.onClick] function called when button is clicked
1718
* @param {'medium'|'small'} [props.size] button size
1819
* @param {'circle'|'rounded'} [props.style] button style
1920
* @param {'button'|'submit'|'reset'} [props.type] button type
@@ -42,13 +43,11 @@ const Button = ({
4243
type={type}
4344
className={cn(
4445
styles.button,
45-
{
46-
[styles.selected]: isSelected,
47-
[styles[color]]: true,
48-
[styles[size]]: true,
49-
[styles[style]]: true,
50-
[styles[variant]]: true,
51-
},
46+
styles[color],
47+
styles[size],
48+
styles[style],
49+
styles[variant],
50+
{ [styles.selected]: isSelected },
5251
className
5352
)}
5453
onClick={onClick}
@@ -60,7 +59,13 @@ const Button = ({
6059
Button.propTypes = {
6160
children: PT.node,
6261
className: PT.string,
63-
color: PT.oneOf(["primary"]),
62+
color: PT.oneOf([
63+
"primary",
64+
"primary-dark",
65+
"primary-light",
66+
"error",
67+
"warning",
68+
]),
6469
isDisabled: PT.bool,
6570
isSelected: PT.bool,
6671
name: PT.string,

0 commit comments

Comments
 (0)