aboutsummaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-11-17 15:49:05 +0300
committerilyayudovin <ilyayudovin123@gmail.com>2020-11-17 15:49:05 +0300
commitfe82b4e0ef835e6921575f1927174479bea7f777 (patch)
tree5227a935584dbbdf68f8be8278a3fdeb7b300734 /src/containers
parent99b4e4aa53d3ade389fc270f9ba9b02904da93f6 (diff)
downloadwhich-ui-fe82b4e0ef835e6921575f1927174479bea7f777.tar.gz
fix: clear eslint errors
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/AvatarCropModal/AvatarCropModal.tsx8
-rw-r--r--src/containers/PollCreation/PollCreation.tsx4
-rw-r--r--src/containers/Profile/ProfileInfo.tsx16
3 files changed, 15 insertions, 13 deletions
diff --git a/src/containers/AvatarCropModal/AvatarCropModal.tsx b/src/containers/AvatarCropModal/AvatarCropModal.tsx
index 4decdfb..e5fcc08 100644
--- a/src/containers/AvatarCropModal/AvatarCropModal.tsx
+++ b/src/containers/AvatarCropModal/AvatarCropModal.tsx
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
-import SendIcon from "@material-ui/icons/Send";
-import { getCroppedImg } from './canvasUtils'
+import SendIcon from '@material-ui/icons/Send';
+import { getCroppedImg } from './canvasUtils';
import ImageCropAreaSelect from '../../components/ImageCropAreaSelect/ImageCropAreaSelect';
import ModalScreen from '../../components/ModalScreen/ModalScreen';
@@ -26,7 +26,7 @@ const useStyles = makeStyles(theme => ({
// background: '#333',
[theme.breakpoints.up('sm')]: {
// height: 400,
- },
+ }
}
}));
@@ -51,7 +51,7 @@ const AvatarCropModal: React.FC<PropTypes> = ({ avatar, callback }) => {
/>
</div>
</ModalScreen>
- )
+ );
};
export default AvatarCropModal;
diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx
index 46ab28d..0a7e78d 100644
--- a/src/containers/PollCreation/PollCreation.tsx
+++ b/src/containers/PollCreation/PollCreation.tsx
@@ -1,9 +1,10 @@
-import React, {ChangeEvent, useState, useMemo, useCallback} from 'react';
+import React, { ChangeEvent, useState, useMemo, useCallback } from 'react';
import Bluebird from 'bluebird';
import { makeStyles } from '@material-ui/core/styles';
import { Card, Container, LinearProgress, InputBase, Typography } from '@material-ui/core';
import SendIcon from '@material-ui/icons/Send';
import { useSnackbar } from 'notistack';
+import { useHistory } from 'react-router';
import useS3Preupload from './useS3Preupload';
import ImageInput from './ImageInput';
@@ -13,7 +14,6 @@ import UserStrip from '../../components/UserStrip/UserStrip';
import { post } from '../../requests';
import { useFeed, useProfile } from '../../hooks/APIClient';
import { useAuth } from '../../hooks/useAuth';
-import {useHistory} from "react-router";
const useStyles = makeStyles(theme => ({
images: {
diff --git a/src/containers/Profile/ProfileInfo.tsx b/src/containers/Profile/ProfileInfo.tsx
index 4c9f17e..777a779 100644
--- a/src/containers/Profile/ProfileInfo.tsx
+++ b/src/containers/Profile/ProfileInfo.tsx
@@ -112,21 +112,23 @@ const ProfileInfo: React.FC<PropTypes> = ({
const dateSince = useMemo(() => formatDate(userInfo?.createdAt), [userInfo]);
const handleUpdateAvatar = useCallback(async (file: File) => {
- if (user) uploadFileToS3(file, 0.8, setProgress)
- .then(avatarUrl => patch(`/users/${user._id}`, { avatarUrl }))
- .then(response => setUserInfo(response.data))
- .then(() => setProgress(0));
+ if (user) {
+ uploadFileToS3(file, 0.8, setProgress)
+ .then(avatarUrl => patch(`/users/${user._id}`, { avatarUrl }))
+ .then(response => setUserInfo(response.data))
+ .then(() => setProgress(0));
+ }
}, [user, setUserInfo]);
- const handleCropAvatar = useCallback( async(file: File) => {
+ const handleCropAvatar = useCallback(async (file: File) => {
const imageSrc = URL.createObjectURL(file);
setAvatarToCrop(imageSrc);
- },[]);
+ }, []);
return (
<div className={classes.root}>
{
- avatarToCrop && <AvatarCropModal avatar={avatarToCrop} callback={handleUpdateAvatar}/>
+ avatarToCrop && <AvatarCropModal avatar={avatarToCrop} callback={handleUpdateAvatar} />
}
{
!userInfo