fix: toast issues (#6209)

This commit is contained in:
Kilu.He 2024-09-06 12:27:08 +08:00 committed by GitHub
parent 93ca6ac906
commit 9930efdc84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 28 deletions

View file

@ -81,11 +81,10 @@ function AppConfig ({ children }: { children: React.ReactNode }) {
enqueueSnackbar(message, { variant: 'success' });
},
error: (message: string) => {
console.log('error', message);
enqueueSnackbar(message, { variant: 'error' });
},
warning: (message: string) => {
enqueueSnackbar(message, { variant: 'warning' });
enqueueSnackbar(message, { variant: 'warning', autoHideDuration: 500000000000 });
},
default: (message: string) => {
enqueueSnackbar(message, { variant: 'default' });

View file

@ -8,29 +8,18 @@ import { styled } from '@mui/material';
import { InfoSnackbar } from '../_shared/notify';
const StyledSnackbarProvider = styled(SnackbarProvider)`
&.notistack-MuiContent-default {
background-color: var(--fill-toolbar);
}
&.notistack-MuiContent-default {
background-color: var(--fill-toolbar);
}
&.notistack-MuiContent-info {
background-color: var(--function-info);
}
&.notistack-MuiContent-info {
background-color: var(--function-info);
}
&.notistack-MuiContent-success {
background-color: var(--function-success);
}
&.notistack-MuiContent-error {
background-color: var(--function-error);
}
&.notistack-MuiContent-warning {
background-color: var(--function-warning);
}
`;
export default function withAppWrapper(Component: React.FC): React.FC {
return function AppWrapper(): JSX.Element {
export default function withAppWrapper (Component: React.FC): React.FC {
return function AppWrapper (): JSX.Element {
return (
<AppTheme>
<ErrorBoundary FallbackComponent={ErrorHandlerPage}>

View file

@ -38,9 +38,9 @@
--function-error: #fb006d;
--function-error-hover: #ff4f8a;
--function-error-opacity: rgba(251, 0, 109, 0.1);
--function-waring: #ffd667;
--function-waring-hover: #ffdf8f;
--function-waring-opacity: rgba(255, 214, 103, 0.1);
--function-warning: #ffd667;
--function-warning-hover: #ffdf8f;
--function-warning-opacity: rgba(255, 214, 103, 0.1);
--function-success: #66cf80;
--function-success-hover: #66cf00;
--function-success-opacity: rgba(102, 207, 128, 0.1);

View file

@ -1,7 +1,7 @@
/**
* Do not edit directly
* Generated on Fri, 06 Sep 2024 02:15:53 GMT
* Generated on Fri, 06 Sep 2024 04:24:51 GMT
* Generated from $pnpm css:variables
*/

View file

@ -1,7 +1,7 @@
/**
* Do not edit directly
* Generated on Fri, 06 Sep 2024 02:15:53 GMT
* Generated on Fri, 06 Sep 2024 04:24:51 GMT
* Generated from $pnpm css:variables
*/
@ -59,8 +59,8 @@ module.exports = {
"function": {
"error": "var(--function-error)",
"error-hover": "var(--function-error-hover)",
"waring": "var(--function-waring)",
"waring-hover": "var(--function-waring-hover)",
"warning": "var(--function-warning)",
"warning-hover": "var(--function-warning-hover)",
"success": "var(--function-success)",
"success-hover": "var(--function-success-hover)",
"info": "var(--function-info)"