File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ import "./button.scss";
55export const Button = ( {
66 children,
77 onClick,
8- type ,
8+ color ,
99 size,
1010 disabled,
1111 inverted,
12- inputType
12+ type
1313} ) => {
1414 const classNames = [ "button" ] ;
1515
16- if ( type ) {
17- classNames . push ( `is-${ type } ` ) ;
16+ if ( color ) {
17+ classNames . push ( `is-${ color } ` ) ;
1818 }
1919
2020 if ( size ) {
@@ -27,7 +27,7 @@ export const Button = ({
2727
2828 return (
2929 < button
30- type = { inputType }
30+ type = { type }
3131 disabled = { disabled }
3232 onClick = { onClick }
3333 className = { classNames . join ( " " ) }
@@ -40,16 +40,16 @@ export const Button = ({
4040Button . propTypes = {
4141 children : PropTypes . node . isRequired ,
4242 onClick : PropTypes . func ,
43- type : PropTypes . oneOf ( [ "primary" , "danger" , "warning" ] ) ,
43+ color : PropTypes . oneOf ( [ "primary" , "danger" , "warning" ] ) ,
4444 size : PropTypes . oneOf ( [ "small" , "medium" , "large" ] ) ,
4545 disabled : PropTypes . bool ,
4646 inverted : PropTypes . bool ,
47- inputType : PropTypes . oneOf ( [ "button" , "submit" , "reset" ] )
47+ type : PropTypes . oneOf ( [ "button" , "submit" , "reset" ] )
4848} ;
4949
5050Button . defaultProps = {
51- type : "primary" ,
51+ color : "primary" ,
5252 disabled : false ,
5353 inverted : false ,
54- inputType : "button"
54+ type : "button"
5555} ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function sayMyName() {
99
1010export const primary = ( ) => {
1111 return (
12- < Button type = "primary" onClick = { sayMyName } >
12+ < Button color = "primary" onClick = { sayMyName } >
1313 Hello Friend
1414 </ Button >
1515 ) ;
@@ -41,7 +41,7 @@ export const disabledAndInverted = () => {
4141
4242export const danger = ( ) => {
4343 return (
44- < Button type = "danger" onClick = { sayMyName } >
44+ < Button color = "danger" onClick = { sayMyName } >
4545 Hello Friend
4646 </ Button >
4747 ) ;
You can’t perform that action at this time.
0 commit comments