all repos — caroster @ 486a83d5fe5fe804ce8c7befbc4314da24d1c19b

[Octree] Group carpool to your event https://caroster.io

frontend/components/Toasts/index.tsx (view raw)

 1import Snackbar from '@material-ui/core/Snackbar';
 2import useToastStore from '../../stores/useToastStore';
 3
 4const Toasts = () => {
 5  const toast = useToastStore(s => s.toast);
 6  const clearToast = useToastStore(s => s.clearToast);
 7
 8  return (
 9    <Snackbar
10      anchorOrigin={{
11        vertical: 'top',
12        horizontal: 'center',
13      }}
14      autoHideDuration={6000}
15      open={!!toast}
16      message={toast}
17      onClose={clearToast}
18    />
19  );
20};
21
22export default Toasts;