Change SnackBar alert in Koneksyon component
This commit is contained in:
@@ -13,12 +13,15 @@ import {
|
|||||||
Snackbar,
|
Snackbar,
|
||||||
Typography
|
Typography
|
||||||
} from '@material-ui/core'
|
} from '@material-ui/core'
|
||||||
import {Alert} from '@material-ui/lab'
|
|
||||||
import Slide from '@material-ui/core/Slide'
|
|
||||||
import {Visibility, VisibilityOff} from '@material-ui/icons'
|
import {Visibility, VisibilityOff} from '@material-ui/icons'
|
||||||
|
import MuiAlert from '@material-ui/lab/Alert'
|
||||||
|
|
||||||
import {validateEmail} from '../../lib/utils/emails'
|
import {validateEmail} from '../../lib/utils/emails'
|
||||||
|
|
||||||
|
function Alert(props) {
|
||||||
|
return <MuiAlert elevation={6} variant='filled' {...props} />
|
||||||
|
}
|
||||||
|
|
||||||
function Koneksyon() {
|
function Koneksyon() {
|
||||||
const [loginError, setError] = useState('')
|
const [loginError, setError] = useState('')
|
||||||
const [credentials, setCredentials] = useState({username: '', password: ''})
|
const [credentials, setCredentials] = useState({username: '', password: ''})
|
||||||
@@ -123,10 +126,9 @@ function Koneksyon() {
|
|||||||
<Snackbar
|
<Snackbar
|
||||||
open={open}
|
open={open}
|
||||||
autoHideDuration={6000}
|
autoHideDuration={6000}
|
||||||
TransitionComponent={Slide}
|
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
>
|
>
|
||||||
<Alert severity='error' onClose={handleClose}>{loginError}</Alert>
|
<Alert severity='error' onClose={handleClose}><strong>{loginError}</strong></Alert>
|
||||||
</Snackbar>
|
</Snackbar>
|
||||||
)}
|
)}
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
Reference in New Issue
Block a user