mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
fix(SnackbarProvider): center alert
This commit is contained in:
1 parent
82adc9497b
commit
9ba8bd683f
2 files changed
+7
-8
No files matched your search
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import MuiAlert from '@material-ui/lab/Alert';
|
||||
|
||||
export function Alert(props) {
|
||||
return <MuiAlert elevation={6} variant='filled' {...props} />;
|
||||
return <MuiAlert style={{ zIndex: 10000 }} elevation={6} variant='filled' {...props} />;
|
||||
}
|
||||
|
||||
export default Alert;
|
||||
@@ -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) => (
|
||||
<div className={classes.alert}>
|
||||
<Alert auto key={alert} severity="success" variant={alert.type}>
|
||||
<Alert key={alert} severity={alert.type} variant="filled">
|
||||
{alert.message}
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user