fix close icon placement for toasts without title
This commit is contained in:
1 parent
c58801f6f7
commit
4cd5cd4bae
1 file changed
+17
-4
@@ -48,12 +48,25 @@ const Toast = ({ variant, title, body, onClick, hasDismiss, hasIcon }) => {
|
|||||||
{title}
|
{title}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
<IconButton onClick={onClick}>
|
{title && (
|
||||||
<CloseIcon />
|
<IconButton onClick={onClick}>
|
||||||
</IconButton>
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<ToastBody body={body} />
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={theme.spacing(2)}
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
<ToastBody body={body} />
|
||||||
|
{!title && (
|
||||||
|
<IconButton onClick={onClick}>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
{hasDismiss && (
|
{hasDismiss && (
|
||||||
<Button
|
<Button
|
||||||
variant="text"
|
variant="text"
|
||||||
|
|||||||
Reference in new issue
Block a user