Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e09cd3e

Browse files
authored
feat: Update UI for error dialog and snackbar (#1971)
* feat: update ui for error dialog and snackbar * update padding for buttons
1 parent 47c7eda commit e09cd3e

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

site/src/components/ConfirmDialog/ConfirmDialog.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ interface StyleProps {
4848
const useStyles = makeStyles((theme) => ({
4949
dialogWrapper: (props: StyleProps) => ({
5050
"& .MuiPaper-root": {
51-
background: props.type === "info" ? theme.palette.primary.main : theme.palette.error.dark,
51+
background: props.type === "info" ? theme.palette.primary.main : theme.palette.background.paper,
52+
border: `1px solid ${theme.palette.divider}`,
53+
},
54+
"& .MuiDialogActions-spacing": {
55+
padding: `0 ${theme.spacing(3.75)}px ${theme.spacing(3.75)}px`,
5256
},
5357
}),
5458
dialogContent: (props: StyleProps) => ({
55-
color: props.type === "info" ? theme.palette.primary.contrastText : theme.palette.error.contrastText,
59+
color: props.type === "info" ? theme.palette.primary.contrastText : theme.palette.text.secondary,
5660
padding: theme.spacing(6),
5761
textAlign: "center",
5862
}),
@@ -61,16 +65,14 @@ const useStyles = makeStyles((theme) => ({
6165
},
6266
description: (props: StyleProps) => ({
6367
color:
64-
props.type === "info"
65-
? fade(theme.palette.primary.contrastText, 0.75)
66-
: fade(theme.palette.error.contrastText, 0.75),
68+
props.type === "info" ? fade(theme.palette.primary.contrastText, 0.75) : fade(theme.palette.text.secondary, 0.75),
6769
lineHeight: "160%",
6870

6971
"& strong": {
7072
color:
7173
props.type === "info"
7274
? fade(theme.palette.primary.contrastText, 0.95)
73-
: fade(theme.palette.error.contrastText, 0.95),
75+
: fade(theme.palette.text.secondary, 0.95),
7476
},
7577
}),
7678
}))

site/src/components/Dialog/Dialog.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({
114114
})}
115115
disabled={confirmLoading}
116116
onClick={onCancel}
117-
variant="contained"
117+
variant="outlined"
118118
>
119119
{cancelText}
120120
</LoadingButton>
@@ -145,10 +145,10 @@ interface StyleProps {
145145

146146
const useButtonStyles = makeStyles((theme) => ({
147147
dialogButton: {
148-
borderRadius: 0,
148+
borderRadius: theme.shape.borderRadius,
149149
fontSize: theme.typography.h6.fontSize,
150150
fontWeight: theme.typography.h5.fontWeight,
151-
padding: theme.spacing(2.25),
151+
padding: `${theme.spacing(0.75)}px ${theme.spacing(2)}px`,
152152
width: "100%",
153153
boxShadow: "none",
154154
},

site/src/components/EnterpriseSnackbar/EnterpriseSnackbar.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ const useStyles = makeStyles((theme) => ({
8181
color: theme.palette.error.contrastText,
8282
},
8383
snackbarContent: {
84+
border: `1px solid ${theme.palette.divider}`,
8485
borderLeft: `4px solid ${theme.palette.primary.main}`,
85-
borderRadius: 0,
86+
borderRadius: theme.shape.borderRadius,
8687
padding: `${theme.spacing(1)}px ${theme.spacing(3)}px ${theme.spacing(1)}px ${theme.spacing(2)}px`,
8788
boxShadow: theme.shadows[6],
8889
alignItems: "inherit",
@@ -94,8 +95,8 @@ const useStyles = makeStyles((theme) => ({
9495
color: theme.palette.info.contrastText,
9596
},
9697
snackbarContentError: {
97-
backgroundColor: theme.palette.error.dark,
98+
backgroundColor: theme.palette.background.paper,
9899
borderLeftColor: theme.palette.error.main,
99-
color: theme.palette.error.contrastText,
100+
color: theme.palette.text.secondary,
100101
},
101102
}))

0 commit comments

Comments
 (0)