aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123.@mail.com>2020-06-07 02:58:36 +0300
committerilyayudovin <ilyayudovin123.@mail.com>2020-06-07 02:58:36 +0300
commit4d3e2f0d19c1957feeebda7f476f4d56b377b86e (patch)
tree4f33a5d3db3f76aca40d4db94f07dc5dc9090efb
parente8b723ae4f046c9f0bee667569e08f7a856855f2 (diff)
downloadwhich-ui-4d3e2f0d19c1957feeebda7f476f4d56b377b86e.tar.gz
fix: fixing all eslint errors
-rw-r--r--.eslintrc.json2
-rw-r--r--src/Header/Header.tsx18
-rw-r--r--src/PollCard/PollCard.tsx47
-rw-r--r--src/index.tsx10
4 files changed, 38 insertions, 39 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 0789840..746c3b9 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -12,7 +12,7 @@
"jsx-quotes": ["error", "prefer-double"],
"quotes": ["error", "single"],
"no-multiple-empty-lines": [2, { "max": 2, "maxEOF": 1 } ],
- "max-len": ["error", { "code": 120 }],
+ "max-len": ["error", { "code": 140 }],
"arrow-parens": [2, "as-needed"],
"comma-dangle": ["error", "never"],
"arrow-body-style": 0,
diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx
index fd2620c..8e8a301 100644
--- a/src/Header/Header.tsx
+++ b/src/Header/Header.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import {
+import {
AppBar,
Toolbar,
Tabs,
@@ -15,23 +15,23 @@ interface PropTypes {
const useStyles = makeStyles(theme => ({
tab: {
'& .MuiTab-wrapper': {
- padding: theme.spacing(2),
- flexDirection: 'row',
- fontSize: '0.8125rem'
+ padding: theme.spacing(2),
+ flexDirection: 'row',
+ fontSize: '0.8125rem'
}
}
}));
-const tabs = ["Profile", "Feed"];
+const tabs = ['Profile', 'Feed'];
-const Header: React.FC<PropTypes> = ({ page, setPage }) => {
+const Header: React.FC<PropTypes> = ({ page /* , setPage */ }) => {
const classes = useStyles();
- const handleChange = () => {}
+ const handleChange = () => {};
return (
<AppBar position="static">
- <Toolbar>
+ <Toolbar>
<Tabs onChange={handleChange} value={page}>
{tabs.map((tab: string) => (
<Tab
@@ -43,7 +43,7 @@ const Header: React.FC<PropTypes> = ({ page, setPage }) => {
</Tabs>
</Toolbar>
</AppBar>
- )
+ );
};
export default Header;
diff --git a/src/PollCard/PollCard.tsx b/src/PollCard/PollCard.tsx
index b514397..a157411 100644
--- a/src/PollCard/PollCard.tsx
+++ b/src/PollCard/PollCard.tsx
@@ -1,43 +1,38 @@
import React from 'react';
-import {makeStyles} from '@material-ui/core/styles';
+import { makeStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
-import CardActions from '@material-ui/core/CardActions';
-import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
-import Button from '@material-ui/core/Button';
-import Typography from '@material-ui/core/Typography';
import Avatar from '@material-ui/core/Avatar';
import CardHeader from '@material-ui/core/CardHeader';
-
const useStyles = makeStyles({
root: {
maxWidth: 600,
height: 500,
- margin: '20px auto',
+ margin: '20px auto'
},
images: {
height: 400,
- width: 300,
+ width: 300
},
imagesBlock: {
- display: 'flex',
+ display: 'flex'
},
- percentageLeft:{
- position:'absolute',
+ percentageLeft: {
+ position: 'absolute',
color: 'white',
top: '86%',
- left:30,
- fontSize:20,
+ left: 30,
+ fontSize: 20
},
- percentageRight:{
+ percentageRight: {
position: 'absolute',
color: 'white',
top: '86%',
- right:30,
- fontSize:20,
+ right: 30,
+ fontSize: 20
}
});
@@ -48,26 +43,30 @@ const PollCard: React.FC = () => {
return (
<Card className={classes.root}>
<CardHeader
- avatar={
+ avatar={(
<Avatar aria-label="avatar">
R
</Avatar>
- }
+ )}
title="Nick Name"
/>
<div className={classes.imagesBlock}>
<CardActionArea>
- <CardMedia className={classes.images}
- image='https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500'/>
+ <CardMedia
+ className={classes.images}
+ image="https://images.pexels.com/photos/556666/pexels-photo-556666.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
+ />
<div className={classes.percentageLeft}>25%</div>
</CardActionArea>
<CardActionArea>
- <CardMedia className={classes.images}
- image='https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg'/>
+ <CardMedia
+ className={classes.images}
+ image="https://cdn.psychologytoday.com/sites/default/files/field_blog_entry_images/2019-06/pexels-photo-556667.jpeg"
+ />
<div className={classes.percentageRight}>75%</div>
</CardActionArea>
</div>
</Card>
);
-}
-export default PollCard; \ No newline at end of file
+};
+export default PollCard;
diff --git a/src/index.tsx b/src/index.tsx
index 0ad62e0..b59876b 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -12,13 +12,13 @@ import PollCard from './PollCard/PollCard';
const theme = createMuiTheme({
palette: {
primary: {
- main: teal[700],
+ main: teal[700]
},
text: {
primary: '#000000',
- secondary: 'rgba(255, 255, 255, 0.6)',
- },
- },
+ secondary: 'rgba(255, 255, 255, 0.6)'
+ }
+ }
});
const App: React.FC = () => {
@@ -28,7 +28,7 @@ const App: React.FC = () => {
<ThemeProvider theme={theme}>
<CssBaseline />
<Header page={page} setPage={setPage} />
- <PollCard/>
+ <PollCard />
</ThemeProvider>
);
};