From 5b08023e0aa0e626264673ebb86dc82299a3b54b Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 27 Jun 2020 19:15:41 +0300 Subject: style: fix ALL linting errors --- src/components/Feed/Feed.tsx | 1 - src/components/Header/Header.tsx | 6 ++--- src/components/Highlight/Highlight.tsx | 39 ------------------------------ src/components/UploadImage/UploadImage.tsx | 25 ++++++++++--------- 4 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 src/components/Highlight/Highlight.tsx (limited to 'src/components') diff --git a/src/components/Feed/Feed.tsx b/src/components/Feed/Feed.tsx index 06b5087..0c4d84f 100644 --- a/src/components/Feed/Feed.tsx +++ b/src/components/Feed/Feed.tsx @@ -18,7 +18,6 @@ const useStyles = makeStyles(theme => ({ const Feed: React.FC = ({ polls, navigate }) => { const classes = useStyles(); - console.log(polls); return (
{polls.map(poll => )} diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index a5e6817..2e3fc20 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -27,7 +27,7 @@ const useStyles = makeStyles({ logo: { fontWeight: 'bold' }, - avatar:{ + avatar: { width: 24, height: 24 } @@ -62,8 +62,8 @@ const Header: React.FC = ({ navigate, userImage }) => { { - userImage!== undefined - ? + userImage !== undefined + ? : } diff --git a/src/components/Highlight/Highlight.tsx b/src/components/Highlight/Highlight.tsx deleted file mode 100644 index 8e11c34..0000000 --- a/src/components/Highlight/Highlight.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React, {useState} from 'react'; -import {makeStyles} from '@material-ui/core/styles'; - -interface PropTypes { - text: string; - value: any; -} - -const useStyles = makeStyles({ - root: { - position: 'relative' - }, - menuButton: { - width: 200, - height: 50, - textAlign: 'center', - }, - menuNumber: { - fontWeight: 800, - color: 'black' - }, - menuText: { - color: 'darkgray' - }, -}); - - -const Highlight: React.FC = ({text, value}) => { - const classes = useStyles(); - - return ( -
-
{value}
-
{text}
-
- ); -}; - -export default Highlight; diff --git a/src/components/UploadImage/UploadImage.tsx b/src/components/UploadImage/UploadImage.tsx index 929151f..42ee989 100644 --- a/src/components/UploadImage/UploadImage.tsx +++ b/src/components/UploadImage/UploadImage.tsx @@ -1,4 +1,4 @@ -import React, {useRef} from 'react'; +import React, { useRef } from 'react'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; import Dialog from '@material-ui/core/Dialog'; @@ -6,28 +6,29 @@ import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogTitle from '@material-ui/core/DialogTitle'; -import {patch} from "../../requests"; -import {User} from 'which-types'; +import { User } from 'which-types'; +import { patch } from '../../requests'; interface PropTypes { - displayD: boolean; - setDisplayD: (d: boolean) => void; - setUserInfo: (a: User) => void; - setUser: (a: User) => void + displayD: boolean; + setDisplayD: (d: boolean) => void; + setUserInfo: (a: User) => void; + setUser: (a: User) => void } -const UploadImage: React.FC = ({displayD,setDisplayD,setUserInfo,setUser}) => { +const UploadImage: React.FC = ({ + displayD, setDisplayD, setUserInfo, setUser +}) => { const urlRef = useRef(null); const handleClose = () => { setDisplayD(false); }; - const updateAvatar = (event: any) => { + const updateAvatar = () => { const id = localStorage.getItem('userId'); const newAvatar = urlRef.current?.value; - console.log(newAvatar); - patch(`/users/${id}`, {avatarUrl: newAvatar}).then(res => { + patch(`/users/${id}`, { avatarUrl: newAvatar }).then(res => { setUserInfo(res.data); setUser(res.data); }); @@ -36,7 +37,7 @@ const UploadImage: React.FC = ({displayD,setDisplayD,setUserInfo,set return (
- + Upload an Image -- cgit v1.2.3