diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-11-17 15:49:05 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123@gmail.com> | 2020-11-17 15:49:05 +0300 |
commit | fe82b4e0ef835e6921575f1927174479bea7f777 (patch) | |
tree | 5227a935584dbbdf68f8be8278a3fdeb7b300734 /src/containers/Profile | |
parent | 99b4e4aa53d3ade389fc270f9ba9b02904da93f6 (diff) | |
download | which-ui-fe82b4e0ef835e6921575f1927174479bea7f777.tar.gz |
fix: clear eslint errors
Diffstat (limited to 'src/containers/Profile')
-rw-r--r-- | src/containers/Profile/ProfileInfo.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
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 |