aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/ProfileBody.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-14 16:02:09 -0800
committerGitHub <noreply@github.com>2020-12-14 19:02:09 -0500
commit3b7bf256d83e1898642c2aab9072ffbeec8cc032 (patch)
tree9b48ff57f61414321e2c78124bd6a63101a04602 /src/components/profile/ProfileBody.tsx
parent410d9224f4e198ab0b8ecae35fa05c240a2439bf (diff)
[TMA - 426] Fix recent search + Add refresh control (#138)
* Got rid of small lint errors before start * Final push * Final * disable scroll first try / logic * small change * Try to make the cover photo consistent with different screen sizes * Final change * added RefreshControl * removed scale effect * Fix misorientation of cover * remove more scale stuff * fix userIDs for different views * Mend refresh control * white bg Co-authored-by: hsalhab <husam_salhab@brown.edu>
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r--src/components/profile/ProfileBody.tsx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx
index 57800578..49ee74ee 100644
--- a/src/components/profile/ProfileBody.tsx
+++ b/src/components/profile/ProfileBody.tsx
@@ -14,7 +14,7 @@ interface ProfileBodyProps {
isOwnProfile: boolean;
handleFollowUnfollow: Function;
handleBlockUnblock: Function;
- userXId: string;
+ userXId: string | undefined;
screenType: ScreenType;
}
const ProfileBody: React.FC<ProfileBodyProps> = ({
@@ -33,7 +33,7 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({
} = userXId
? useSelector((state: RootState) => state.userX[screenType][userXId])
: useSelector((state: RootState) => state.user);
-
+
const {biography, website} = profile;
return (
<View onLayout={onLayout} style={styles.container}>
@@ -41,11 +41,15 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({
{biography.length > 0 && (
<Text style={styles.biography}>{`${biography}`}</Text>
)}
- {website.length > 0 && <Text style={styles.website} onPress={() => {
- Linking.openURL(
- website.startsWith('http') ? website : 'http://' + website,
- );
- }}>{`${website}`}</Text>}
+ {website.length > 0 && (
+ <Text
+ style={styles.website}
+ onPress={() => {
+ Linking.openURL(
+ website.startsWith('http') ? website : 'http://' + website,
+ );
+ }}>{`${website}`}</Text>
+ )}
{userXId && !isOwnProfile ? (
<View style={styles.toggleButtonContainer}>
{!isBlocked && (