aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Login.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/ui/Login.js')
-rw-r--r--vnext/src/ui/Login.js27
1 files changed, 16 insertions, 11 deletions
diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js
index 649fadd4..883a4eab 100644
--- a/vnext/src/ui/Login.js
+++ b/vnext/src/ui/Login.js
@@ -1,10 +1,7 @@
-import React, { useState, useEffect } from 'react';
-import PropTypes from 'prop-types';
+import React, { useEffect } from 'react';
-import ReactRouterPropTypes from 'react-router-prop-types';
import { withRouter } from 'react-router-dom';
-import { UserType } from './Types';
import Icon from './Icon';
import Button from './Button';
import Input from './Input';
@@ -14,6 +11,18 @@ import { me, facebookLink, vkLink } from '../api';
import './Login.css';
+/**
+ * @typedef {Object} LoginProps
+ * @property {import('../api').SecureUser} visitor
+ * @property {import('history').History} history
+ * @property {import('history').Location} location
+ * @property {any} onAuth
+ */
+
+/**
+ * Login page
+ * @param {LoginProps} props
+ */
function Login({ visitor, history, location, onAuth }) {
useEffect(() => {
@@ -26,6 +35,9 @@ function Login({ visitor, history, location, onAuth }) {
const [formState, { text, password }] = useFormState();
+ /**
+ * @param {React.SyntheticEvent} event
+ */
let onSubmit = (event) => {
event.preventDefault();
me(formState.values.username, formState.values.password)
@@ -66,13 +78,6 @@ function Login({ visitor, history, location, onAuth }) {
export default withRouter(Login);
-Login.propTypes = {
- visitor: UserType,
- history: ReactRouterPropTypes.history.isRequired,
- location: ReactRouterPropTypes.location,
- onAuth: PropTypes.func
-};
-
const socialButtonsStyle = {
display: 'flex',
justifyContent: 'space-evenly',