File tree 1 file changed +9
-17
lines changed
1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ const CAlert = props => {
12
12
//
13
13
onShowChange,
14
14
closeButton,
15
- transition,
16
15
color,
17
16
fade,
18
17
show,
@@ -30,11 +29,11 @@ const CAlert = props => {
30
29
)
31
30
32
31
const alertTransition = {
33
- ...CFade . defaultProps ,
34
- ...transition ,
35
- baseClass : fade ? transition . baseClass : '' ,
36
- timeout : fade ? transition . timeout : 0
32
+ baseClass : fade ? CFade . baseClass : '' ,
33
+ timeout : fade ? CFade . timeout : 0 ,
34
+ unmountOnExit : true
37
35
}
36
+
38
37
const [ isOpen , setIsOpen ] = useState ( show )
39
38
40
39
useEffect ( ( ) => {
@@ -63,10 +62,8 @@ const CAlert = props => {
63
62
role = "alert"
64
63
{ ...attributes }
65
64
>
66
- { children }
67
- { closeButton && < CButtonClose
68
- onClick = { ( ) => setIsOpen ( false ) }
69
- /> }
65
+ { children }
66
+ { closeButton && < CButtonClose onClick = { ( ) => setIsOpen ( false ) } /> }
70
67
</ CFade >
71
68
)
72
69
}
@@ -81,18 +78,13 @@ CAlert.propTypes = {
81
78
color : PropTypes . string ,
82
79
fade : PropTypes . bool ,
83
80
show : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . number ] ) ,
84
- transition : PropTypes . shape ( CFade . propTypes ) ,
85
81
} ;
86
82
87
83
CAlert . defaultProps = {
88
84
tag : 'div' ,
89
85
//
90
86
show : true ,
91
- fade : true ,
92
- transition : {
93
- ...CFade . defaultProps ,
94
- unmountOnExit : true ,
95
- }
96
- }
97
- //export
87
+ fade : true
88
+ } ;
89
+
98
90
export default CAlert
You can’t perform that action at this time.
0 commit comments