@@ -5,7 +5,7 @@ import CloseIcon from "@material-ui/icons/Close"
5
5
import { FC } from "react"
6
6
import { combineClasses } from "../../util/combineClasses"
7
7
8
- type EnterpriseSnackbarVariant = "error" | "info"
8
+ type EnterpriseSnackbarVariant = "error" | "info" | "success"
9
9
10
10
export interface EnterpriseSnackbarProps extends MuiSnackbarProps {
11
11
/** Called when the snackbar should close, either from timeout or clicking close */
@@ -45,7 +45,7 @@ export const EnterpriseSnackbar: FC<EnterpriseSnackbarProps> = ({
45
45
< div className = { styles . actionWrapper } >
46
46
{ action }
47
47
< IconButton onClick = { onClose } className = { styles . iconButton } >
48
- < CloseIcon className = { variant === "info" ? styles . closeIcon : styles . closeIconError } />
48
+ < CloseIcon className = { styles . closeIcon } />
49
49
</ IconButton >
50
50
</ div >
51
51
}
@@ -55,6 +55,7 @@ export const EnterpriseSnackbar: FC<EnterpriseSnackbarProps> = ({
55
55
[ styles . snackbarContent ] : true ,
56
56
[ styles . snackbarContentInfo ] : variant === "info" ,
57
57
[ styles . snackbarContentError ] : variant === "error" ,
58
+ [ styles . snackbarContentSuccess ] : variant === "success" ,
58
59
} ) ,
59
60
} }
60
61
onClose = { onClose }
@@ -73,12 +74,7 @@ const useStyles = makeStyles((theme) => ({
73
74
closeIcon : {
74
75
width : 25 ,
75
76
height : 25 ,
76
- color : theme . palette . info . contrastText ,
77
- } ,
78
- closeIconError : {
79
- width : 25 ,
80
- height : 25 ,
81
- color : theme . palette . error . contrastText ,
77
+ color : theme . palette . primary . contrastText ,
82
78
} ,
83
79
snackbarContent : {
84
80
border : `1px solid ${ theme . palette . divider } ` ,
@@ -87,16 +83,17 @@ const useStyles = makeStyles((theme) => ({
87
83
padding : `${ theme . spacing ( 1 ) } px ${ theme . spacing ( 3 ) } px ${ theme . spacing ( 1 ) } px ${ theme . spacing ( 2 ) } px` ,
88
84
boxShadow : theme . shadows [ 6 ] ,
89
85
alignItems : "inherit" ,
86
+ backgroundColor : theme . palette . background . paper ,
87
+ color : theme . palette . text . secondary ,
90
88
} ,
91
89
snackbarContentInfo : {
92
- backgroundColor : theme . palette . info . main ,
93
- // Use primary color as a highlight
90
+ // Use success color as a highlight
94
91
borderLeftColor : theme . palette . primary . main ,
95
- color : theme . palette . info . contrastText ,
96
92
} ,
97
93
snackbarContentError : {
98
- backgroundColor : theme . palette . background . paper ,
99
94
borderLeftColor : theme . palette . error . main ,
100
- color : theme . palette . text . secondary ,
95
+ } ,
96
+ snackbarContentSuccess : {
97
+ borderLeftColor : theme . palette . success . main ,
101
98
} ,
102
99
} ) )
0 commit comments