Commit 65001776 authored by chenshouchao's avatar chenshouchao

feat: message组件增加关闭按钮、样式同步设计稿

parent ea94f661
...@@ -66,6 +66,7 @@ const MySnackbarProvider = ({ ...@@ -66,6 +66,7 @@ const MySnackbarProvider = ({
}: MySnackbarProviderProp) => { }: MySnackbarProviderProp) => {
const { const {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
...@@ -96,9 +97,35 @@ const MySnackbarProvider = ({ ...@@ -96,9 +97,35 @@ const MySnackbarProvider = ({
MuiAlert: { MuiAlert: {
styleOverrides: { styleOverrides: {
root: { root: {
color: getColorStyle, width: "360px",
"& .MuiAlert-icon": { height: "38px",
color: getColorStyle, "&.MuiAlert-standardError": {
color: "#FF4E4E",
background: "rgba(255, 237, 237, 1)",
"& .MuiAlert-icon": {
color: "#FF4E4E",
},
},
"&.MuiAlert-standardInfo": {
color: "rgba(19, 112, 255, 1)",
background: "rgba(235, 243, 255, 1)",
"& .MuiAlert-icon": {
color: "rgba(19, 112, 255, 1)",
},
},
"&.MuiAlert-standardSuccess": {
color: "rgba(2, 171, 131, 1)",
background: "rgba(217, 255, 238, 1)",
"& .MuiAlert-icon": {
color: "rgba(2, 171, 131, 1)",
},
},
"&.MuiAlert-standardWarning": {
color: "rgba(255, 185, 25, 1)",
background: "rgba(255, 246, 226, 1)",
"& .MuiAlert-icon": {
color: "rgba(255, 185, 25, 1)",
},
}, },
}, },
}, },
...@@ -138,6 +165,9 @@ const MySnackbarProvider = ({ ...@@ -138,6 +165,9 @@ const MySnackbarProvider = ({
variant={variant} variant={variant}
elevation={elevation} elevation={elevation}
sx={{ boxShadow: "unset", ...alertSx }} sx={{ boxShadow: "unset", ...alertSx }}
onClose={() => {
setOpen(false);
}}
> >
{messageInfo?.content} {messageInfo?.content}
</Alert> </Alert>
......
...@@ -69,6 +69,7 @@ const useMySnackbar = () => { ...@@ -69,6 +69,7 @@ const useMySnackbar = () => {
return { return {
open, open,
setOpen,
messageInfo, messageInfo,
handleExited, handleExited,
success, success,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment