1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

removed redux completely

This commit is contained in:
Fedor Katurov 2022-01-09 19:03:01 +07:00
parent 26e6d8d41b
commit a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions

View file

@ -0,0 +1,38 @@
import React, { FC } from 'react';
import { Button } from '~/components/input/Button';
import { Grid } from '~/components/containers/Grid';
import { Group } from '~/components/containers/Group';
import styles from './styles.module.scss';
import { OAuthProvider } from '~/types/auth';
interface IProps {
openOauthWindow: (provider: OAuthProvider) => void;
}
const LoginDialogButtons: FC<IProps> = ({ openOauthWindow }) => (
<Group className={styles.footer}>
<Button>Войти</Button>
<Grid columns="repeat(2, 1fr)">
<Button
color="outline"
iconLeft="google"
type="button"
onClick={() => openOauthWindow('google')}
>
<span>Google</span>
</Button>
<Button
color="outline"
iconLeft="vk"
type="button"
onClick={() => openOauthWindow('vkontakte')}
>
<span>Вконтакте</span>
</Button>
</Grid>
</Group>
);
export { LoginDialogButtons };

View file

@ -0,0 +1,5 @@
@import "src/styles/variables";
.footer {
padding: $gap;
}

View file

@ -0,0 +1,13 @@
import React, { FC } from 'react';
import { Button } from '~/components/input/Button';
import styles from './styles.module.scss';
interface IProps {}
const LoginSocialRegisterButtons: FC<IProps> = () => (
<div className={styles.wrap}>
<Button color="secondary">Впустите меня!</Button>
</div>
);
export { LoginSocialRegisterButtons };

View file

@ -0,0 +1,9 @@
@import "src/styles/variables";
.wrap {
padding: $gap $gap * 2;
button {
width: 100%;
}
}

View file

@ -0,0 +1,27 @@
import React, { VFC } from 'react';
import styles from './styles.module.scss';
import { Group } from '~/components/containers/Group';
import { Icon } from '~/components/input/Icon';
import { ERROR_LITERAL, ERRORS } from '~/constants/errors';
import { Button } from '~/components/input/Button';
interface RestoreInvalidCodeProps {
error: string;
onClose: () => void;
}
const RestoreInvalidCode: VFC<RestoreInvalidCodeProps> = ({ error, onClose }) => (
<Group className={styles.error_shade}>
<Icon icon="close" size={64} />
<div>{error || ERROR_LITERAL[ERRORS.CODE_IS_INVALID]}</div>
<div className={styles.spacer} />
<Button color="primary" onClick={onClose}>
Очень жаль
</Button>
</Group>
);
export { RestoreInvalidCode };

View file

@ -0,0 +1,35 @@
@import "src/styles/variables";
.error_shade {
@include outer_shadow();
background: $content_bg;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: $radius;
padding: $gap * 2;
box-sizing: border-box;
text-transform: uppercase;
font: $font_18_semibold;
text-align: center;
color: $wisegreen;
svg {
fill: $wisegreen;
}
}
.error_shade {
color: $red;
svg {
fill: $red;
}
}

View file

@ -0,0 +1,25 @@
import React, { VFC } from 'react';
import styles from './styles.module.scss';
import { Icon } from '~/components/input/Icon';
import { Button } from '~/components/input/Button';
import { Group } from '~/components/containers/Group';
interface RestoreSentProps {
onClose: () => void;
}
const RestoreSent: VFC<RestoreSentProps> = ({ onClose }) => (
<Group className={styles.shade}>
<Icon icon="check" size={64} />
<div>Проверьте почту, мы отправили на неё код</div>
<div />
<Button color="secondary" onClick={onClose}>
Отлично!
</Button>
</Group>
);
export { RestoreSent };

View file

@ -0,0 +1,27 @@
@import "src/styles/variables";
.shade {
@include outer_shadow();
background: $content_bg;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: $radius;
padding: $gap * 2;
box-sizing: border-box;
text-transform: uppercase;
font: $font_18_semibold;
text-align: center;
color: $wisegreen;
svg {
fill: $wisegreen;
}
}

View file

@ -0,0 +1,27 @@
import React, { VFC } from 'react';
import { Icon } from '~/components/input/Icon';
import { Button } from '~/components/input/Button';
import { Group } from '~/components/containers/Group';
import styles from './styles.module.scss';
interface RestoreSuccessProps {
username?: string;
onClick: () => void;
}
const RestoreSuccess: VFC<RestoreSuccessProps> = ({ username, onClick }) => (
<Group className={styles.shade}>
<Icon icon="check" size={64} />
<div>Пароль обновлен</div>
<div>Добро пожаловать домой{username ? `, ~${username}` : ''}!</div>
<div />
<Button color="secondary" onClick={onClick}>
Ура!
</Button>
</Group>
);
export { RestoreSuccess };

View file

@ -0,0 +1,27 @@
@import "src/styles/variables";
.shade {
@include outer_shadow();
background: $content_bg;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: $radius;
padding: $gap * 2;
box-sizing: border-box;
text-transform: uppercase;
font: $font_18_semibold;
text-align: center;
color: $wisegreen;
svg {
fill: $wisegreen;
}
}