From e884ad25b4f2358406eee8a2766890291538a518 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Thu, 13 May 2021 12:16:49 -0700 Subject: Cleaned up code somewhat --- src/components/profile/Cover.tsx | 36 +++++++++++++++++------------------ src/components/profile/TaggAvatar.tsx | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) (limited to 'src/components') diff --git a/src/components/profile/Cover.tsx b/src/components/profile/Cover.tsx index 82231417..5d5b4234 100644 --- a/src/components/profile/Cover.tsx +++ b/src/components/profile/Cover.tsx @@ -13,7 +13,7 @@ import GreyPurplePlus from '../../assets/icons/grey-purple-plus.svg'; import {useDispatch, useSelector} from 'react-redux'; import {loadUserData, resetHeaderAndProfileImage} from '../../store/actions'; import {RootState} from '../../store/rootreducer'; -import {patchProfile, validateImageLink} from '../../utils'; +import {normalize, patchProfile, validateImageLink} from '../../utils'; interface CoverProps { userXId: string | undefined; @@ -44,7 +44,7 @@ const Cover: React.FC = ({userXId, screenType}) => { const handleNewImage = async () => { setLoading(true); - const result = await patchProfile('Select Header Picture', user.userId); + const result = await patchProfile('header', user.userId); setLoading(true); if (result) { setNeedsUpdate(true); @@ -62,22 +62,20 @@ const Cover: React.FC = ({userXId, screenType}) => { if (!validImage && userXId === undefined && !loading) { return ( - <> - - - handleNewImage()}> - - Add Picture - - - - + + + handleNewImage()}> + + Add Picture + + + ); } else { return ( @@ -108,7 +106,7 @@ const styles = StyleSheet.create({ text: { color: 'white', position: 'absolute', - fontSize: 18, + fontSize: normalize(16), top: 80, right: 20, }, diff --git a/src/components/profile/TaggAvatar.tsx b/src/components/profile/TaggAvatar.tsx index 1f6bbba6..304b9e3a 100644 --- a/src/components/profile/TaggAvatar.tsx +++ b/src/components/profile/TaggAvatar.tsx @@ -46,7 +46,7 @@ const TaggAvatar: React.FC = ({ const handleNewImage = async () => { setLoading(true); - const result = await patchProfile('Select Profile Picture', user.userId); + const result = await patchProfile('profile', user.userId); if (result) { setNeedsUpdate(true); } else { -- cgit v1.2.3-70-g09d2