Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
754128e9
Commit
754128e9
authored
Aug 05, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改提示信息默认显示时间
parent
cd3761aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
MySnackbarProvider.tsx
src/components/MySnackbar/MySnackbarProvider.tsx
+13
-16
No files found.
src/components/MySnackbar/MySnackbarProvider.tsx
View file @
754128e9
...
...
@@ -43,7 +43,7 @@ const getTransitionComponent = (transition: "grow" | "fade") => {
const
MySnackbarProvider
=
({
vertical
=
"top"
,
horizontal
=
"center"
,
autoHideDuration
=
890
000
,
autoHideDuration
=
3
000
,
snackerClasses
,
ClickAwayListenerProps
,
ContentProps
,
...
...
@@ -76,20 +76,20 @@ const MySnackbarProvider = ({
}
=
useMySnackbar
();
// .MuiAlert-filledInfo
const
getColorStyle
=
useMemo
(()
=>
{
if
(
messageInfo
.
severity
===
'success'
)
{
return
'#02AB83'
const
getColorStyle
=
useMemo
(()
=>
{
if
(
messageInfo
.
severity
===
"success"
)
{
return
"#02AB83"
;
}
if
(
messageInfo
.
severity
===
'info'
)
{
return
'#1370FF'
if
(
messageInfo
.
severity
===
"info"
)
{
return
"#1370FF"
;
}
if
(
messageInfo
.
severity
===
'warning'
)
{
return
'#FFB919'
if
(
messageInfo
.
severity
===
"warning"
)
{
return
"#FFB919"
;
}
if
(
messageInfo
.
severity
===
'error'
)
{
return
'#FF4E4E'
if
(
messageInfo
.
severity
===
"error"
)
{
return
"#FF4E4E"
;
}
},[
messageInfo
.
severity
])
},
[
messageInfo
.
severity
]);
const
theme
=
createTheme
({
components
:
{
...
...
@@ -98,20 +98,17 @@ const MySnackbarProvider = ({
root
:
{
color
:
getColorStyle
,
"& .MuiAlert-icon"
:
{
color
:
getColorStyle
color
:
getColorStyle
,
},
},
}
},
},
},
});
return
(
<
Fragment
>
<
ThemeProvider
theme=
{
theme
}
>
<
Snackbar
open=
{
open
}
autoHideDuration=
{
autoHideDuration
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment