mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
added nowhere motel scene
This commit is contained in:
parent
7458fb2e55
commit
a3501859a0
7 changed files with 5355 additions and 75 deletions
|
@ -1,58 +0,0 @@
|
|||
import { FC } from 'react';
|
||||
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import { useLoginForm } from '~/hooks/auth/useLoginForm';
|
||||
import { IUser } from '~/types/auth';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface LoginFormProps {
|
||||
login: (username: string, password: string) => Promise<IUser>;
|
||||
onSuccess: () => void;
|
||||
onRestoreRequest: () => void;
|
||||
}
|
||||
|
||||
const LoginForm: FC<LoginFormProps> = ({
|
||||
login,
|
||||
onSuccess,
|
||||
onRestoreRequest,
|
||||
}) => {
|
||||
const { values, errors, handleSubmit, handleChange } = useLoginForm(
|
||||
login,
|
||||
onSuccess,
|
||||
);
|
||||
|
||||
return (
|
||||
<Group>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<InputText
|
||||
title="Логин"
|
||||
handler={handleChange('username')}
|
||||
value={values.username}
|
||||
error={errors.username}
|
||||
autoFocus
|
||||
/>
|
||||
|
||||
<InputText
|
||||
title="Пароль"
|
||||
handler={handleChange('password')}
|
||||
value={values.password}
|
||||
error={errors.password}
|
||||
type="password"
|
||||
/>
|
||||
|
||||
<Button
|
||||
color="link"
|
||||
type="button"
|
||||
onClick={onRestoreRequest}
|
||||
className={styles.forgot_button}
|
||||
>
|
||||
Вспомнить пароль
|
||||
</Button>
|
||||
</form>
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
export { LoginForm };
|
|
@ -1,3 +0,0 @@
|
|||
.forgot_button {
|
||||
opacity: 0.5;
|
||||
}
|
|
@ -1,11 +1,15 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface LoginStaticSceneProps {}
|
||||
interface LoginStaticSceneProps {
|
||||
scene?: 'clouds' | 'nowhere';
|
||||
}
|
||||
|
||||
const LoginStaticScene: FC<LoginStaticSceneProps> = () => (
|
||||
<div className={styles.scene} />
|
||||
const LoginStaticScene: FC<LoginStaticSceneProps> = ({ scene = 'login' }) => (
|
||||
<div className={classNames(styles.scene, styles[scene])} />
|
||||
);
|
||||
|
||||
export { LoginStaticScene };
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
background: url('/images/clouds.svg') no-repeat 50% 50%;
|
||||
background-size: cover;
|
||||
&.clouds {
|
||||
background: url('/images/clouds.svg') no-repeat 50% 50%;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
&.nowhere {
|
||||
background: url('/images/nowhere_motel.svg') no-repeat 50% 50%;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue