Skip to content

Commit

Permalink
docs:typescript:formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed Oct 3, 2023
1 parent c34c583 commit dca67f5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 29 deletions.
28 changes: 11 additions & 17 deletions docs/data/material/components/snackbars/CustomizedSnackbars.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import Snackbar from '@mui/material/Snackbar';
import MuiAlert from '@mui/material/Alert';

const Alert = React.forwardRef(function Alert(props, ref) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
});
import Alert from '@mui/material/Alert';

export default function CustomizedSnackbars() {
const [open, setOpen] = React.useState(false);
Expand All @@ -24,19 +19,18 @@ export default function CustomizedSnackbars() {
};

return (
<Stack spacing={2} sx={{ width: '100%' }}>
<Button variant="outlined" onClick={handleClick}>
Open success snackbar
</Button>
<div>
<Button onClick={handleClick}>Open snackbar</Button>
<Snackbar open={open} autoHideDuration={6000} onClose={handleClose}>
<Alert onClose={handleClose} severity="success" sx={{ width: '100%' }}>
This is a success message!
<Alert
onClose={handleClose}
severity="success"
variant="filled"
sx={{ width: '100%' }}
>
This is a success Alert inside a Snackbar!
</Alert>
</Snackbar>
<Alert severity="error">This is an error message!</Alert>
<Alert severity="warning">This is a warning message!</Alert>
<Alert severity="info">This is an information message!</Alert>
<Alert severity="success">This is a success message!</Alert>
</Stack>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Button variant="outlined" onClick={handleClick}>
Open success snackbar
</Button>
<Button onClick={handleClick}>Open snackbar</Button>
<Snackbar open={open} autoHideDuration={6000} onClose={handleClose}>
<Alert onClose={handleClose} severity="success" sx={{ width: '100%' }}>
This is a success message!
<Alert
onClose={handleClose}
severity="success"
variant="filled"
sx={{ width: '100%' }}
>
This is a success Alert inside a Snackbar!
</Alert>
</Snackbar>
<Alert severity="error">This is an error message!</Alert>
<Alert severity="warning">This is a warning message!</Alert>
<Alert severity="info">This is an information message!</Alert>
<Alert severity="success">This is a success message!</Alert>
</Snackbar>
2 changes: 1 addition & 1 deletion docs/data/material/components/snackbars/SimpleSnackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function SimpleSnackbar() {

return (
<div>
<Button onClick={handleClick}>Open simple snackbar</Button>
<Button onClick={handleClick}>Open snackbar</Button>
<Snackbar
open={open}
autoHideDuration={6000}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Button onClick={handleClick}>Open simple snackbar</Button>
<Button onClick={handleClick}>Open snackbar</Button>
<Snackbar
open={open}
autoHideDuration={6000}
Expand Down

0 comments on commit dca67f5

Please sign in to comment.