chore: Optimize tips
This commit is contained in:
parent
7c9bf359fd
commit
c2773b40c7
@ -1,24 +1,56 @@
|
|||||||
|
import { closeSnackbar } from 'notistack';
|
||||||
|
import { IconX } from '@tabler/icons-react';
|
||||||
|
import { IconButton } from '@mui/material';
|
||||||
|
const action = (snackbarId) => (
|
||||||
|
<>
|
||||||
|
<IconButton
|
||||||
|
onClick={() => {
|
||||||
|
closeSnackbar(snackbarId);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconX stroke={1.5} size="1.25rem" />
|
||||||
|
</IconButton>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
export const snackbarConstants = {
|
export const snackbarConstants = {
|
||||||
Common: {
|
Common: {
|
||||||
ERROR: {
|
ERROR: {
|
||||||
variant: 'error',
|
variant: 'error',
|
||||||
autoHideDuration: 5000
|
autoHideDuration: 5000,
|
||||||
|
preventDuplicate: true,
|
||||||
|
action
|
||||||
},
|
},
|
||||||
WARNING: {
|
WARNING: {
|
||||||
variant: 'warning',
|
variant: 'warning',
|
||||||
autoHideDuration: 10000
|
autoHideDuration: 10000,
|
||||||
|
preventDuplicate: true,
|
||||||
|
action
|
||||||
},
|
},
|
||||||
SUCCESS: {
|
SUCCESS: {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
autoHideDuration: 1500
|
autoHideDuration: 1500,
|
||||||
|
preventDuplicate: true,
|
||||||
|
action
|
||||||
},
|
},
|
||||||
INFO: {
|
INFO: {
|
||||||
variant: 'info',
|
variant: 'info',
|
||||||
autoHideDuration: 3000
|
autoHideDuration: 3000,
|
||||||
|
preventDuplicate: true,
|
||||||
|
action
|
||||||
},
|
},
|
||||||
NOTICE: {
|
NOTICE: {
|
||||||
variant: 'info',
|
variant: 'info',
|
||||||
autoHideDuration: 7000
|
autoHideDuration: 20000,
|
||||||
|
preventDuplicate: true,
|
||||||
|
action
|
||||||
|
},
|
||||||
|
COPY: {
|
||||||
|
variant: 'copy',
|
||||||
|
persist: true,
|
||||||
|
preventDuplicate: true,
|
||||||
|
allowDownload: true,
|
||||||
|
action
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Mobile: {
|
Mobile: {
|
||||||
|
Loading…
Reference in New Issue
Block a user