From 282bd3180b149571cfc5caad98d8b462596157ef Mon Sep 17 00:00:00 2001 From: ilyayudovin Date: Fri, 12 Jun 2020 19:41:54 +0300 Subject: fix: clear eslint errors --- src/ProfileInfo/ProfileInfo.tsx | 12 +++++------- src/index.tsx | 38 +------------------------------------- 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/src/ProfileInfo/ProfileInfo.tsx b/src/ProfileInfo/ProfileInfo.tsx index 05a2b78..2bba586 100644 --- a/src/ProfileInfo/ProfileInfo.tsx +++ b/src/ProfileInfo/ProfileInfo.tsx @@ -1,8 +1,8 @@ -import React, {useEffect, useState} from 'react'; +import React, { useState } from 'react'; import { Avatar } from '@material-ui/core/'; import { makeStyles } from '@material-ui/core/styles'; -import {Poll, User} from "../types"; -import {get} from "../requests"; +import { User } from '../types'; +import { get } from '../requests'; interface PropTypes { id: string; @@ -37,10 +37,8 @@ const useStyles = makeStyles({ const ProfileInfo: React.FC = ({ id }) => { const [userInfo, setUserInfo] = useState(); - let endpoint: string = '/users/' + id; - - get(endpoint).then(response => { - setUserInfo(response.data) + get(`/users/ + ${id}`).then(response => { + setUserInfo(response.data); }); const classes = useStyles(); diff --git a/src/index.tsx b/src/index.tsx index 530cd82..9fb34cb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -21,42 +21,6 @@ const theme = createMuiTheme({ } }); -const polls = [{ - author: { - name: 'John Doe', - avatarUrl: '' - }, - contents: { - left: { - // eslint-disable-next-line max-len - url: 'https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', - votes: 15 - }, - right: { - // eslint-disable-next-line max-len - url: 'https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg', - votes: 17 - } - } -}, { - author: { - name: 'John Doe', - avatarUrl: '' - }, - contents: { - left: { - // eslint-disable-next-line max-len - url: 'https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', - votes: 15 - }, - right: { - // eslint-disable-next-line max-len - url: 'https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg', - votes: 17 - } - } -}]; - const useStyles = makeStyles({ root: { width: theme.spacing(75), @@ -75,7 +39,7 @@ const App: React.FC = () => {
{ - page === 'profile' && + page === 'profile' && }
-- cgit v1.2.3