From 9ba8bd683f5597357d3901f43efff34b92ab4529 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 11 Feb 2021 21:12:19 +0100 Subject: [PATCH] fix(SnackbarProvider): center alert --- phone/src/ui/components/Alert.tsx | 2 +- phone/src/ui/components/SnackbarProvider.tsx | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/phone/src/ui/components/Alert.tsx b/phone/src/ui/components/Alert.tsx index 103e28b..697fb4c 100644 --- a/phone/src/ui/components/Alert.tsx +++ b/phone/src/ui/components/Alert.tsx @@ -2,7 +2,7 @@ import React from 'react'; import MuiAlert from '@material-ui/lab/Alert'; export function Alert(props) { - return ; + return ; } export default Alert; diff --git a/phone/src/ui/components/SnackbarProvider.tsx b/phone/src/ui/components/SnackbarProvider.tsx index 34d76b8..d25e301 100644 --- a/phone/src/ui/components/SnackbarProvider.tsx +++ b/phone/src/ui/components/SnackbarProvider.tsx @@ -6,17 +6,16 @@ import { ISnackbar } from '../interface/InterfaceUI'; const useStyles = makeStyles(() => ({ alert: { - position: 'absolute', - bottom: '15%', - right: '25%', - margin: '0 auto', - textAlign: 'center' + marginTop: '-100px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center' } })) export const SnackbarContext = createContext(null); -const AUTO_HIDE = 1500; +const AUTO_HIDE = 2000; function SnackbarProvider({ children }) { const [alerts, setAlerts] = useState([]); @@ -39,7 +38,7 @@ function SnackbarProvider({ children }) { {children} {alerts.map((alert: ISnackbar) => (
- + {alert.message}