@material-ui/icons#LockOutlined JavaScript Examples
The following examples show how to use
@material-ui/icons#LockOutlined.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Header.js From AED-Map with MIT License | 6 votes |
Header = () => {
const classes = useStyles();
return (
<>
<Avatar className={classes.avatar}>
<LockOutlined />
</Avatar>
<Typography component="h1" variant="h5">
Відновити пароль
</Typography>
</>
);
}
Example #2
Source File: Header.js From AED-Map with MIT License | 6 votes |
Header = () => {
const classes = useStyles();
return (
<>
<Avatar className={classes.avatar}>
<LockOutlined />
</Avatar>
<Typography component="h1" variant="h5">
Увійти
</Typography>
</>
);
}
Example #3
Source File: Header.js From AED-Map with MIT License | 6 votes |
Header = () => {
const classes = useStyles();
return (
<>
<Avatar className={classes.avatar}>
<LockOutlined />
</Avatar>
<Typography component="h1" variant="h5">
Зареєструвати
</Typography>
</>
);
}
Example #4
Source File: index.js From whaticket with MIT License | 4 votes |
Login = () => {
const classes = useStyles();
const [user, setUser] = useState({ email: "", password: "" });
const [showPassword, setShowPassword] = useState(false);
const { handleLogin } = useContext(AuthContext);
const handleChangeInput = (e) => {
setUser({ ...user, [e.target.name]: e.target.value });
};
const handlSubmit = (e) => {
e.preventDefault();
handleLogin(user);
};
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<div className={classes.paper}>
<Avatar className={classes.avatar}>
<LockOutlined />
</Avatar>
<Typography component="h1" variant="h5">
{i18n.t("login.title")}
</Typography>
<form className={classes.form} noValidate onSubmit={handlSubmit}>
<TextField
variant="outlined"
margin="normal"
required
fullWidth
id="email"
label={i18n.t("login.form.email")}
name="email"
value={user.email}
onChange={handleChangeInput}
autoComplete="email"
autoFocus
/>
<TextField
variant="outlined"
margin="normal"
required
fullWidth
name="password"
label={i18n.t("login.form.password")}
id="password"
value={user.password}
onChange={handleChangeInput}
autoComplete="current-password"
type={showPassword ? 'text' : 'password'}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
onClick={() => setShowPassword((e) => !e)}
>
{showPassword ? <VisibilityOff /> : <Visibility />}
</IconButton>
</InputAdornment>
)
}}
/>
<Button
type="submit"
fullWidth
variant="contained"
color="primary"
className={classes.submit}
>
{i18n.t("login.buttons.submit")}
</Button>
<Grid container>
<Grid item>
<Link
href="#"
variant="body2"
component={RouterLink}
to="/signup"
>
{i18n.t("login.buttons.register")}
</Link>
</Grid>
</Grid>
</form>
</div>
<Box mt={8}>{/* <Copyright /> */}</Box>
</Container>
);
}
Example #5
Source File: index.js From whaticket with MIT License | 4 votes |
SignUp = () => {
const classes = useStyles();
const history = useHistory();
const initialState = { name: "", email: "", password: "" };
const [showPassword, setShowPassword] = useState(false);
const [user] = useState(initialState);
const handleSignUp = async values => {
try {
await api.post("/auth/signup", values);
toast.success(i18n.t("signup.toasts.success"));
history.push("/login");
} catch (err) {
toastError(err);
}
};
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<div className={classes.paper}>
<Avatar className={classes.avatar}>
<LockOutlined />
</Avatar>
<Typography component="h1" variant="h5">
{i18n.t("signup.title")}
</Typography>
{/* <form className={classes.form} noValidate onSubmit={handleSignUp}> */}
<Formik
initialValues={user}
enableReinitialize={true}
validationSchema={UserSchema}
onSubmit={(values, actions) => {
setTimeout(() => {
handleSignUp(values);
actions.setSubmitting(false);
}, 400);
}}
>
{({ touched, errors, isSubmitting }) => (
<Form className={classes.form}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Field
as={TextField}
autoComplete="name"
name="name"
error={touched.name && Boolean(errors.name)}
helperText={touched.name && errors.name}
variant="outlined"
fullWidth
id="name"
label={i18n.t("signup.form.name")}
autoFocus
/>
</Grid>
<Grid item xs={12}>
<Field
as={TextField}
variant="outlined"
fullWidth
id="email"
label={i18n.t("signup.form.email")}
name="email"
error={touched.email && Boolean(errors.email)}
helperText={touched.email && errors.email}
autoComplete="email"
/>
</Grid>
<Grid item xs={12}>
<Field
as={TextField}
variant="outlined"
fullWidth
name="password"
id="password"
autoComplete="current-password"
error={touched.password && Boolean(errors.password)}
helperText={touched.password && errors.password}
label={i18n.t("signup.form.password")}
type={showPassword ? 'text' : 'password'}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
onClick={() => setShowPassword((e) => !e)}
>
{showPassword ? <VisibilityOff /> : <Visibility />}
</IconButton>
</InputAdornment>
)
}}
/>
</Grid>
</Grid>
<Button
type="submit"
fullWidth
variant="contained"
color="primary"
className={classes.submit}
>
{i18n.t("signup.buttons.submit")}
</Button>
<Grid container justifyContent="flex-end">
<Grid item>
<Link
href="#"
variant="body2"
component={RouterLink}
to="/login"
>
{i18n.t("signup.buttons.login")}
</Link>
</Grid>
</Grid>
</Form>
)}
</Formik>
</div>
<Box mt={5}>{/* <Copyright /> */}</Box>
</Container>
);
}