|
| 1 | +// import React from 'react'; |
| 2 | +// import PropTypes from 'prop-types'; |
| 3 | +// import Button from '@material-ui/core/Button'; |
| 4 | +// import Snackbar from '@material-ui/core/Snackbar'; |
| 5 | +// import SnackbarContentWrapper from './SnackbarContentWrapper.jsx'; |
| 6 | + |
| 7 | +// const Snackbars = (props) => { |
| 8 | +// const { |
| 9 | +// successOpen, errorOpen, handleNotificationClose, msg, viewAppDir, |
| 10 | +// } = props; |
| 11 | +// const successMsg = <div>Your files were successfully created. <Button |
| 12 | +// variant='fab' |
| 13 | +// mini |
| 14 | +// aria-label='View app directory' |
| 15 | +// onClick={viewAppDir} |
| 16 | +// >View</Button></div>; |
| 17 | +// const errMsg = `There was an error while creating your files. ${msg}`; |
| 18 | +// return ( |
| 19 | +// <div> |
| 20 | +// <Snackbar |
| 21 | +// anchorOrigin={{ |
| 22 | +// vertical: 'bottom', |
| 23 | +// horizontal: 'left', |
| 24 | +// }} |
| 25 | +// open={successOpen} |
| 26 | +// autoHideDuration={5000} |
| 27 | +// > |
| 28 | +// <SnackbarContentWrapper |
| 29 | +// onClose={handleNotificationClose} |
| 30 | +// variant="success" |
| 31 | +// message={successMsg} |
| 32 | +// /> |
| 33 | +// </Snackbar> |
| 34 | +// <Snackbar |
| 35 | +// anchorOrigin={{ |
| 36 | +// vertical: 'bottom', |
| 37 | +// horizontal: 'left', |
| 38 | +// }} |
| 39 | +// open={errorOpen} |
| 40 | +// autoHideDuration={5000} |
| 41 | +// > |
| 42 | +// <SnackbarContentWrapper |
| 43 | +// onClose={handleNotificationClose} |
| 44 | +// variant="error" |
| 45 | +// message={errMsg} |
| 46 | +// /> |
| 47 | +// </Snackbar> |
| 48 | +// </div> |
| 49 | +// ); |
| 50 | +// }; |
| 51 | + |
| 52 | +// Snackbars.propTypes = { |
| 53 | +// successOpen: PropTypes.bool.isRequired, |
| 54 | +// errorOpen: PropTypes.bool.isRequired, |
| 55 | +// msg: PropTypes.string.isRequired, |
| 56 | +// viewAppDir: PropTypes.func.isRequired, |
| 57 | +// handleNotificationClose: PropTypes.func.isRequired, |
| 58 | +// }; |
| 59 | + |
| 60 | +// export default Snackbars; |
0 commit comments