1 | import { MaterialDesignContent } from 'notistack';
|
---|
2 | // @mui
|
---|
3 | import { styled, alpha } from '@mui/material/styles';
|
---|
4 |
|
---|
5 | // ----------------------------------------------------------------------
|
---|
6 |
|
---|
7 | export const StyledNotistack = styled(MaterialDesignContent)(({ theme }) => {
|
---|
8 | const isLight = theme.palette.mode === 'light';
|
---|
9 |
|
---|
10 | return {
|
---|
11 | '& #notistack-snackbar': {
|
---|
12 | ...theme.typography.subtitle2,
|
---|
13 | padding: 0,
|
---|
14 | flexGrow: 1,
|
---|
15 | },
|
---|
16 | '&.notistack-MuiContent': {
|
---|
17 | padding: theme.spacing(0.5),
|
---|
18 | paddingRight: theme.spacing(2),
|
---|
19 | color: theme.palette.text.primary,
|
---|
20 | boxShadow: theme.customShadows.z8,
|
---|
21 | borderRadius: theme.shape.borderRadius,
|
---|
22 | backgroundColor: theme.palette.background.paper,
|
---|
23 | },
|
---|
24 | '&.notistack-MuiContent-default': {
|
---|
25 | padding: theme.spacing(1),
|
---|
26 | color: isLight ? theme.palette.common.white : theme.palette.grey[800],
|
---|
27 | backgroundColor: isLight ? theme.palette.grey[800] : theme.palette.common.white,
|
---|
28 | },
|
---|
29 | // '&.notistack-MuiContent-info': {},
|
---|
30 | // '&.notistack-MuiContent-success': {},
|
---|
31 | // '&.notistack-MuiContent-warning': {},
|
---|
32 | // '&.notistack-MuiContent-error': {},
|
---|
33 | };
|
---|
34 | });
|
---|
35 |
|
---|
36 | // ----------------------------------------------------------------------
|
---|
37 |
|
---|
38 | type StyledIconProps = {
|
---|
39 | color: 'info' | 'success' | 'warning' | 'error';
|
---|
40 | };
|
---|
41 |
|
---|
42 | export const StyledIcon = styled('span')<StyledIconProps>(({ color, theme }) => ({
|
---|
43 | width: 44,
|
---|
44 | height: 44,
|
---|
45 | display: 'flex',
|
---|
46 | alignItems: 'center',
|
---|
47 | justifyContent: 'center',
|
---|
48 | marginRight: theme.spacing(1.5),
|
---|
49 | color: theme.palette[color].main,
|
---|
50 | borderRadius: theme.shape.borderRadius,
|
---|
51 | backgroundColor: alpha(theme.palette[color].main, 0.16),
|
---|
52 | }));
|
---|