Skip to content

Commit

Permalink
feat: Update UI for error dialog and snackbar (#1971)
Browse files Browse the repository at this point in the history
* feat: update ui for error dialog and snackbar

* update padding for buttons
  • Loading branch information
AbhineetJain committed Jun 2, 2022
1 parent 47c7eda commit e09cd3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions site/src/components/ConfirmDialog/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ interface StyleProps {
const useStyles = makeStyles((theme) => ({
dialogWrapper: (props: StyleProps) => ({
"& .MuiPaper-root": {
background: props.type === "info" ? theme.palette.primary.main : theme.palette.error.dark,
background: props.type === "info" ? theme.palette.primary.main : theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
},
"& .MuiDialogActions-spacing": {
padding: `0 ${theme.spacing(3.75)}px ${theme.spacing(3.75)}px`,
},
}),
dialogContent: (props: StyleProps) => ({
color: props.type === "info" ? theme.palette.primary.contrastText : theme.palette.error.contrastText,
color: props.type === "info" ? theme.palette.primary.contrastText : theme.palette.text.secondary,
padding: theme.spacing(6),
textAlign: "center",
}),
Expand All @@ -61,16 +65,14 @@ const useStyles = makeStyles((theme) => ({
},
description: (props: StyleProps) => ({
color:
props.type === "info"
? fade(theme.palette.primary.contrastText, 0.75)
: fade(theme.palette.error.contrastText, 0.75),
props.type === "info" ? fade(theme.palette.primary.contrastText, 0.75) : fade(theme.palette.text.secondary, 0.75),
lineHeight: "160%",

"& strong": {
color:
props.type === "info"
? fade(theme.palette.primary.contrastText, 0.95)
: fade(theme.palette.error.contrastText, 0.95),
: fade(theme.palette.text.secondary, 0.95),
},
}),
}))
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({
})}
disabled={confirmLoading}
onClick={onCancel}
variant="contained"
variant="outlined"
>
{cancelText}
</LoadingButton>
Expand Down Expand Up @@ -145,10 +145,10 @@ interface StyleProps {

const useButtonStyles = makeStyles((theme) => ({
dialogButton: {
borderRadius: 0,
borderRadius: theme.shape.borderRadius,
fontSize: theme.typography.h6.fontSize,
fontWeight: theme.typography.h5.fontWeight,
padding: theme.spacing(2.25),
padding: `${theme.spacing(0.75)}px ${theme.spacing(2)}px`,
width: "100%",
boxShadow: "none",
},
Expand Down
7 changes: 4 additions & 3 deletions site/src/components/EnterpriseSnackbar/EnterpriseSnackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ const useStyles = makeStyles((theme) => ({
color: theme.palette.error.contrastText,
},
snackbarContent: {
border: `1px solid ${theme.palette.divider}`,
borderLeft: `4px solid ${theme.palette.primary.main}`,
borderRadius: 0,
borderRadius: theme.shape.borderRadius,
padding: `${theme.spacing(1)}px ${theme.spacing(3)}px ${theme.spacing(1)}px ${theme.spacing(2)}px`,
boxShadow: theme.shadows[6],
alignItems: "inherit",
Expand All @@ -94,8 +95,8 @@ const useStyles = makeStyles((theme) => ({
color: theme.palette.info.contrastText,
},
snackbarContentError: {
backgroundColor: theme.palette.error.dark,
backgroundColor: theme.palette.background.paper,
borderLeftColor: theme.palette.error.main,
color: theme.palette.error.contrastText,
color: theme.palette.text.secondary,
},
}))

0 comments on commit e09cd3e

Please sign in to comment.