From 2a65284a385915818ca5f3e3b7354554e19af9cb Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 15 Jun 2020 15:52:40 +0300 Subject: style: fix eslint errors --- src/components/PollCard/PercentageBar.tsx | 4 ++-- src/components/PollCard/PollCard.tsx | 19 ++++++++----------- src/index.tsx | 21 ++++++++++++--------- src/pages/ProfilePage/ProfilePage.tsx | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/components/PollCard/PercentageBar.tsx b/src/components/PollCard/PercentageBar.tsx index bf88815..6a50a9e 100644 --- a/src/components/PollCard/PercentageBar.tsx +++ b/src/components/PollCard/PercentageBar.tsx @@ -6,7 +6,7 @@ interface PropTypes { which: 'left' | 'right'; } -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles({ root: { position: 'absolute', color: 'white', @@ -20,7 +20,7 @@ const useStyles = makeStyles(theme => ({ right: { right: 30 } -})); +}); const PercentageBar: React.FC = ({ value, which }) => { const classes = useStyles(); diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index 7f587f3..23dc342 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -5,8 +5,7 @@ import { CardActionArea, CardMedia, Avatar, - CardHeader, -Link + CardHeader } from '@material-ui/core/'; import { Poll } from '../../types'; import PercentageBar from './PercentageBar'; @@ -28,7 +27,7 @@ const useStyles = makeStyles(theme => ({ }, imagesBlock: { display: 'flex' - }, + } })); @@ -47,14 +46,12 @@ const PollCard: React.FC = ({ poll, navigate }) => { - - + )} title={author.name} /> diff --git a/src/index.tsx b/src/index.tsx index d7326cb..876491d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -39,14 +39,17 @@ const App: React.FC = () => { const classes = useStyles(); const navigate = (prefix: string, id?: string): void => { - if (prefix === 'profile' && !id && !user) setPage({ - prefix: 'auth', - id: '' - }); - else setPage({ - prefix, - id: (id || user?._id || '') - }); + if (prefix === 'profile' && !id && !user) { + setPage({ + prefix: 'auth', + id: '' + }); + } else { + setPage({ + prefix, + id: (id || user?._id || '') + }); + } }; const logOut = () => { @@ -71,7 +74,7 @@ const App: React.FC = () => {
{ page.prefix === 'profile' && } { page.prefix === 'feed' && } - { page.prefix === 'auth' && } + { page.prefix === 'auth' && }
); diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx index 46637cb..0f5fb2b 100644 --- a/src/pages/ProfilePage/ProfilePage.tsx +++ b/src/pages/ProfilePage/ProfilePage.tsx @@ -1,4 +1,4 @@ -import React, { useState,useEffect } from 'react'; +import React, { useState, useEffect } from 'react'; import { User, Poll } from '../../types'; import ProfileInfo from './ProfileInfo'; import Feed from '../../components/Feed/Feed'; -- cgit v1.2.3