From fbdaa40e7ce585b65038835c05a283cec6f28d0e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 24 Jun 2020 00:52:26 +0300 Subject: chore: migrate to which-types@1.3.1 --- src/pages/AuthPage/SignUpForm.tsx | 9 ++++----- src/pages/FeedPage/FeedPage.tsx | 3 ++- src/pages/ProfilePage/ProfileInfo.tsx | 4 ++-- src/pages/ProfilePage/ProfilePage.tsx | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/pages') diff --git a/src/pages/AuthPage/SignUpForm.tsx b/src/pages/AuthPage/SignUpForm.tsx index 2769eb0..0e3d0c7 100644 --- a/src/pages/AuthPage/SignUpForm.tsx +++ b/src/pages/AuthPage/SignUpForm.tsx @@ -31,12 +31,11 @@ const SignUpForm: React.FC = ({ logIn }) => { const inputRefPassword = useRef(); const onClick = () => { - const name = inputRef.current?.value; + const username = inputRef.current?.value; const password = inputRefPassword.current?.value; - const newUser = { name, password }; - if (name && password) { - post('/users', newUser).then(() => { - logIn(name, password); + if (username && password) { + post('/users', { username, password }).then(() => { + logIn(username, password); }); } }; diff --git a/src/pages/FeedPage/FeedPage.tsx b/src/pages/FeedPage/FeedPage.tsx index fd75190..937b0a9 100644 --- a/src/pages/FeedPage/FeedPage.tsx +++ b/src/pages/FeedPage/FeedPage.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react'; -import { Poll } from '../../types'; +import { Poll } from 'which-types'; + import Feed from '../../components/Feed/Feed'; import { get } from '../../requests'; diff --git a/src/pages/ProfilePage/ProfileInfo.tsx b/src/pages/ProfilePage/ProfileInfo.tsx index bddecd8..7208ec8 100644 --- a/src/pages/ProfilePage/ProfileInfo.tsx +++ b/src/pages/ProfilePage/ProfileInfo.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Avatar } from '@material-ui/core/'; import { makeStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/Button/Button'; -import { User } from '../../types'; +import { User } from 'which-types'; interface PropTypes { user: User | undefined; @@ -41,7 +41,7 @@ const ProfileInfo: React.FC = ({ user, logOut }) => {
- {user?.name} + {user?.username}
diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx index 0f5fb2b..363d4ff 100644 --- a/src/pages/ProfilePage/ProfilePage.tsx +++ b/src/pages/ProfilePage/ProfilePage.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react'; -import { User, Poll } from '../../types'; +import { User, Poll } from 'which-types'; + import ProfileInfo from './ProfileInfo'; import Feed from '../../components/Feed/Feed'; import { get } from '../../requests'; -- cgit v1.2.3