Removed ripple effect from icon button and renamed bools

This commit is contained in:
Daniel Cojocea committed 2024-07-11 16:54:25 -04:00
1 parent 5ca6850b4a
commit e9cb0aa339
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -27,7 +27,7 @@ const icons = {
* @returns {JSX.Element} * @returns {JSX.Element}
*/ */
const Alert = ({ variant, title, body, toast, hasIcon = true, onClick }) => { const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
const theme = useTheme(); const theme = useTheme();
const { bg, border, color } = theme.alert[variant]; const { bg, border, color } = theme.alert[variant];
const icon = icons[variant]; const icon = icons[variant];
@@ -50,7 +50,7 @@ const Alert = ({ variant, title, body, toast, hasIcon = true, onClick }) => {
<Stack direction="column" gap="2px" sx={{ flex: 1, color: color }}> <Stack direction="column" gap="2px" sx={{ flex: 1, color: color }}>
{title && <Box sx={{ fontWeight: "700" }}>{title}</Box>} {title && <Box sx={{ fontWeight: "700" }}>{title}</Box>}
{body && <Box sx={{ fontWeight: "400" }}>{body}</Box>} {body && <Box sx={{ fontWeight: "400" }}>{body}</Box>}
{hasIcon && toast && ( {hasIcon && isToast && (
<Button <Button
level="tertiary" level="tertiary"
label="Dismiss" label="Dismiss"
@@ -72,7 +72,7 @@ const Alert = ({ variant, title, body, toast, hasIcon = true, onClick }) => {
></Button> ></Button>
)} )}
</Stack> </Stack>
{toast && ( {isToast && (
<IconButton <IconButton
onClick={onClick} onClick={onClick}
sx={{ sx={{
@@ -84,6 +84,10 @@ const Alert = ({ variant, title, body, toast, hasIcon = true, onClick }) => {
"&:focus": { "&:focus": {
outline: "none", outline: "none",
}, },
"& .MuiTouchRipple-root": {
pointerEvents: "none",
display: "none",
},
}} }}
> >
<CloseIcon <CloseIcon
+1 -1
View File
@@ -470,7 +470,7 @@ const Demo = () => {
<Alert <Alert
variant="info" variant="info"
body="Your password is incorrect." body="Your password is incorrect."
toast={true} isToast={true}
hasIcon={false} hasIcon={false}
/> />
</Box> </Box>