mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed login dialog
This commit is contained in:
parent
430b39e977
commit
c2e977e48f
4 changed files with 55 additions and 26 deletions
|
@ -95,7 +95,11 @@
|
|||
width: 100%;
|
||||
height: 40px;
|
||||
pointer-events: none;
|
||||
background: linear-gradient($red, transparentize($red, 1));
|
||||
background: linear-gradient(0deg, $red 50%, transparentize($red, 1));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0 0 $radius $radius;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
|
|
|
@ -1,35 +1,37 @@
|
|||
import React, { FC, FormEvent, useCallback, useEffect, useState } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { ScrollDialog } from '../ScrollDialog';
|
||||
import { IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import * as styles from './styles.scss';
|
||||
import { selectAuthLogin } from '~/redux/auth/selectors';
|
||||
import * as ACTIONS from '~/redux/auth/actions';
|
||||
import { API } from '~/constants/api';
|
||||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
import React, { FC, FormEvent, useCallback, useEffect, useState } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { ScrollDialog } from "../ScrollDialog";
|
||||
import { IDialogProps } from "~/redux/modal/constants";
|
||||
import { useCloseOnEscape } from "~/utils/hooks";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import { InputText } from "~/components/input/InputText";
|
||||
import { Button } from "~/components/input/Button";
|
||||
import { Padder } from "~/components/containers/Padder";
|
||||
import * as styles from "./styles.scss";
|
||||
import { selectAuthLogin } from "~/redux/auth/selectors";
|
||||
import * as ACTIONS from "~/redux/auth/actions";
|
||||
import { API } from "~/constants/api";
|
||||
import { BetterScrollDialog } from "../BetterScrollDialog";
|
||||
|
||||
const mapStateToProps = selectAuthLogin;
|
||||
|
||||
const mapDispatchToProps = {
|
||||
userSendLoginRequest: ACTIONS.userSendLoginRequest,
|
||||
userSetLoginError: ACTIONS.userSetLoginError,
|
||||
userSetLoginError: ACTIONS.userSetLoginError
|
||||
};
|
||||
|
||||
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & IDialogProps & {};
|
||||
type IProps = ReturnType<typeof mapStateToProps> &
|
||||
typeof mapDispatchToProps &
|
||||
IDialogProps & {};
|
||||
|
||||
const LoginDialogUnconnected: FC<IProps> = ({
|
||||
onRequestClose,
|
||||
error,
|
||||
userSendLoginRequest,
|
||||
userSetLoginError,
|
||||
userSetLoginError
|
||||
}) => {
|
||||
const [username, setUserName] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [username, setUserName] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const onSubmit = useCallback(
|
||||
(event: FormEvent) => {
|
||||
|
@ -40,7 +42,7 @@ const LoginDialogUnconnected: FC<IProps> = ({
|
|||
);
|
||||
|
||||
const onSocialLogin = useCallback(() => {
|
||||
window.open(API.USER.VKONTAKTE_LOGIN, '', 'width=600,height=400');
|
||||
window.open(API.USER.VKONTAKTE_LOGIN, "", "width=600,height=400");
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -59,17 +61,38 @@ const LoginDialogUnconnected: FC<IProps> = ({
|
|||
|
||||
return (
|
||||
<form onSubmit={onSubmit}>
|
||||
<BetterScrollDialog width={260} error={error} onClose={onRequestClose} footer={buttons}>
|
||||
<BetterScrollDialog
|
||||
width={260}
|
||||
error={error}
|
||||
onClose={onRequestClose}
|
||||
footer={buttons}
|
||||
>
|
||||
<Padder>
|
||||
<div className={styles.wrap}>
|
||||
<Group>
|
||||
<h2>РЕШИТЕЛЬНО ВОЙТИ</h2>
|
||||
|
||||
<InputText title="Логин" handler={setUserName} value={username} autoFocus />
|
||||
<InputText title="Пароль" handler={setPassword} value={password} />
|
||||
<InputText
|
||||
title="Логин"
|
||||
handler={setUserName}
|
||||
value={username}
|
||||
autoFocus
|
||||
/>
|
||||
|
||||
<InputText
|
||||
title="Пароль"
|
||||
handler={setPassword}
|
||||
value={password}
|
||||
type="password"
|
||||
/>
|
||||
|
||||
<Group className={styles.buttons}>
|
||||
<Button className={styles.vk} iconLeft="vk" type="button" onClick={onSocialLogin}>
|
||||
<Button
|
||||
className={styles.vk}
|
||||
iconLeft="vk"
|
||||
type="button"
|
||||
onClick={onSocialLogin}
|
||||
>
|
||||
<span>Вконтакте</span>
|
||||
</Button>
|
||||
</Group>
|
||||
|
|
|
@ -4,7 +4,7 @@ $vk_color: darken(desaturate($blue, 100%), 30%);
|
|||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding: $gap;
|
||||
padding: $gap $gap 30px $gap;
|
||||
|
||||
button {
|
||||
text-align: left;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// color 0, 0, 68 is pretty cool, btw
|
||||
// $red: #ff3344;
|
||||
$red: #ff3344;
|
||||
$yellow: #ffd60f;
|
||||
|
@ -9,6 +10,7 @@ $olive: #8bc12a;
|
|||
$orange: #ff7549;
|
||||
$grass: #41800d;
|
||||
$wisegreen: #007962;
|
||||
// $wisegreen: #006868;
|
||||
|
||||
$red_gradient: linear-gradient(165deg, $orange -50%, $red 150%);
|
||||
$blue_gradient: linear-gradient(170deg, $green, $dark_blue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue