aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Login.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-07-26 13:22:00 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:55 +0300
commitf707d3d524d8d16e2bb780764f029d85fc57ecc0 (patch)
tree1580074a665bd16c9744b5749c2a777700c5ae73 /vnext/src/ui/Login.js
parent6016b0888e77497e15384f1cd024eb42672129a4 (diff)
prop-types -> jsdoc
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',