aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-10-18 16:37:32 -0700
committerGitHub <noreply@github.com>2020-10-18 19:37:32 -0400
commitab7fa09af967e0a8cf2ca53dfb24f8bc8a6886f7 (patch)
tree898e7aa42529eda91964ac1a18aa1881689554f2 /src/components/profile/Content.tsx
parent79d237f616c37940f5d476eb1dca6b5d05cf148a (diff)
[TMA 279] Ability to search and view someone's profile (#58)
* Batch one : major changes * WIP checkpoint * The one before the final touch * Probable final touch * ran yarn lint D: * linter broke something * fixed a small bug * Addressed a small nitpick * Well abstracted now Co-authored-by: Ivan Chen <ivan@thetaggid.com>
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index a3b9e74a..8d368747 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -1,5 +1,6 @@
import React, {useState} from 'react';
import {LayoutChangeEvent, StyleSheet, View} from 'react-native';
+import {Text} from 'react-native-animatable';
import Animated from 'react-native-reanimated';
import {defaultMoments} from '../../constants';
import {SCREEN_HEIGHT} from '../../utils';
@@ -11,8 +12,9 @@ import ProfileHeader from './ProfileHeader';
interface ContentProps {
y: Animated.Value<number>;
+ isProfileView: boolean;
}
-const Content: React.FC<ContentProps> = ({y}) => {
+const Content: React.FC<ContentProps> = ({y, isProfileView}) => {
const [profileBodyHeight, setProfileBodyHeight] = useState(0);
const onLayout = (e: LayoutChangeEvent) => {
const {height} = e.nativeEvent.layout;
@@ -26,15 +28,19 @@ const Content: React.FC<ContentProps> = ({y}) => {
scrollEventThrottle={1}
stickyHeaderIndices={[2, 4]}>
<ProfileCutout>
- <ProfileHeader />
+ <ProfileHeader {...{isProfileView}} />
</ProfileCutout>
- <ProfileBody {...{onLayout}} />
- <TaggsBar {...{y, profileBodyHeight}} />
- <View style={styles.momentsContainer}>
- {defaultMoments.map((title, index) => (
- <Moment key={index} title={title} images={[]} />
- ))}
- </View>
+ <ProfileBody {...{onLayout, isProfileView}} />
+ <TaggsBar {...{y, profileBodyHeight, isProfileView}} />
+ {!isProfileView ? (
+ <View style={styles.momentsContainer}>
+ {defaultMoments.map((title, index) => (
+ <Moment key={index} title={title} images={[]} />
+ ))}
+ </View>
+ ) : (
+ <React.Fragment />
+ )}
</Animated.ScrollView>
);
};