This repository was archived by the owner on Mar 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-20
lines changed
buffetjs-hooks/src/useIsMounted Expand file tree Collapse file tree 4 files changed +19
-20
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,16 @@ function Example() {
113
113
Text
114
114
</ Button >
115
115
</ div >
116
+ < div className = "btn-wrapper" >
117
+ < Button
118
+ type = "submit"
119
+ color = "delete"
120
+ icon = { < FontAwesomeIcon icon = { faBaseballBall } /> }
121
+ disabled
122
+ >
123
+ Disabled
124
+ </ Button >
125
+ </ div >
116
126
</ section >
117
127
</ >
118
128
</ Presentation >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useRef, useEffect } from 'react';
3
3
// Hook taken from https://github.com/hupe1980/react-is-mounted-hook
4
4
5
5
function useIsMounted ( ) {
6
- const ref = useRef ( false ) ;
6
+ const ref = useRef ( true ) ;
7
7
8
8
useEffect ( ( ) => {
9
9
ref . current = true ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const colors = {
68
68
backgroundColor : '#6DBB1A' ,
69
69
} ,
70
70
disabled : {
71
- borderColor : '#B4B6BA ' ,
71
+ borderColor : '#E9EAEB ' ,
72
72
color : '#B4B6BA' ,
73
73
backgroundColor : '#E9EAEB' ,
74
74
} ,
Original file line number Diff line number Diff line change @@ -41,16 +41,6 @@ const Button = styled.button`
41
41
vertical-align: initial;
42
42
}
43
43
44
- ${ ( { disabled } ) =>
45
- disabled &&
46
- `
47
- &:hover {
48
- box-shadow: none;
49
- cursor: initial;
50
- }
51
- ` }
52
-
53
-
54
44
// Specific style
55
45
${ ( { color } ) =>
56
46
color !== 'none' &&
@@ -60,15 +50,15 @@ const Button = styled.button`
60
50
color: ${ colors . button [ color ] . color } ;
61
51
` }
62
52
63
- ${ ( { color, disabled } ) =>
64
- color !== 'cancel' &&
65
- color !== 'none' &&
53
+ ${ ( { disabled } ) =>
66
54
disabled &&
67
55
`
68
- &:disabled {
69
- background-color: ${ colors . button . disabled . backgroundColor } ;
70
- border: 1px solid ${ colors . button . disabled . borderColor } ;
71
- color: ${ colors . button . disabled . color } ;
56
+ background-color: ${ colors . button . disabled . backgroundColor } ;
57
+ border: 1px solid ${ colors . button . disabled . borderColor } ;
58
+ color: ${ colors . button . disabled . color } ;
59
+ &:hover {
60
+ box-shadow: none;
61
+ cursor: initial;
72
62
}
73
63
` }
74
64
@@ -84,7 +74,6 @@ const Button = styled.button`
84
74
`
85
75
min-width: ${ sizes . button . minWidth . small } ;
86
76
` }
87
-
88
77
` ;
89
78
90
79
Button . defaultProps = {
You can’t perform that action at this time.
0 commit comments