aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/screens/profile/IndividualMoment.tsx19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx
index 80438bcd..f8113aba 100644
--- a/src/screens/profile/IndividualMoment.tsx
+++ b/src/screens/profile/IndividualMoment.tsx
@@ -9,7 +9,12 @@ import {AVATAR_DIM} from '../../constants';
import {MainStackParams} from '../../routes';
import {RootState} from '../../store/rootreducer';
import {MomentPostType} from '../../types';
-import {isIPhoneX, normalize, StatusBarHeight} from '../../utils';
+import {
+ isIPhoneX,
+ normalize,
+ SCREEN_HEIGHT,
+ StatusBarHeight,
+} from '../../utils';
/**
* Individual moment view opened when user clicks on a moment tile
@@ -92,6 +97,7 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({
<FlatList
ref={scrollRef}
data={momentData}
+ contentContainerStyle={styles.listContentContainer}
renderItem={({item, index}) => (
<MomentPost
moment={item}
@@ -103,6 +109,14 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({
keyExtractor={(item, _) => item.moment_id}
showsVerticalScrollIndicator={false}
initialScrollIndex={initialIndex}
+ onScrollToIndexFailed={() => {
+ // TODO: code below does not work, index resets to 0
+ // const wait = new Promise((resolve) => setTimeout(resolve, 500));
+ // wait.then(() => {
+ // console.log('scrolling to ', initialIndex);
+ // scrollRef.current?.scrollToIndex({index: initialIndex});
+ // });
+ }}
/>
</BlurView>
</MomentContext.Provider>
@@ -116,6 +130,9 @@ const styles = StyleSheet.create({
header: {
height: normalize(70),
},
+ listContentContainer: {
+ paddingBottom: SCREEN_HEIGHT * 0.2,
+ },
});
export default IndividualMoment;