diff options
-rw-r--r-- | src/components/moments/IndividualMomentTitleBar.tsx | 1 | ||||
-rw-r--r-- | src/screens/profile/IndividualMoment.tsx | 26 |
2 files changed, 9 insertions, 18 deletions
diff --git a/src/components/moments/IndividualMomentTitleBar.tsx b/src/components/moments/IndividualMomentTitleBar.tsx index 79453ade..2bebafa7 100644 --- a/src/components/moments/IndividualMomentTitleBar.tsx +++ b/src/components/moments/IndividualMomentTitleBar.tsx @@ -30,7 +30,6 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', - height: '5%', }, headerContainer: { width: '80%', diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 4ad4515d..f8015720 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -8,7 +8,12 @@ import {IndividualMomentTitleBar, MomentPost} from '../../components'; import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootreducer'; import {MomentType} from '../../types'; -import {SCREEN_HEIGHT, SCREEN_WIDTH, StatusBarHeight} from '../../utils'; +import { + normalize, + SCREEN_HEIGHT, + SCREEN_WIDTH, + StatusBarHeight, +} from '../../utils'; /** * Individual moment view opened when user clicks on a moment tile @@ -23,8 +28,6 @@ interface IndividualMomentProps { navigation: IndividualMomentNavigationProp; } -const ITEM_HEIGHT = SCREEN_HEIGHT * 0.9; - const IndividualMoment: React.FC<IndividualMomentProps> = ({ route, navigation, @@ -50,7 +53,7 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ <IndividualMomentTitleBar style={styles.header} close={() => navigation.pop()} - {...{title: moment_category}} + title={moment_category} /> <View style={styles.content}> <FlatList @@ -58,18 +61,9 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ renderItem={({item}: {item: MomentType}) => ( <MomentPost userXId={userXId} screenType={screenType} item={item} /> )} - keyExtractor={(item, index) => index.toString()} + keyExtractor={(_, index) => index.toString()} showsVerticalScrollIndicator={false} - snapToAlignment={'start'} - snapToInterval={ITEM_HEIGHT} - decelerationRate={'fast'} initialScrollIndex={initialIndex} - getItemLayout={(data, index) => ({ - length: ITEM_HEIGHT, - offset: ITEM_HEIGHT * index, - index, - })} - pagingEnabled /> </View> </BlurView> @@ -87,11 +81,9 @@ const styles = StyleSheet.create({ flex: 9, }, header: { - flex: 1, + height: normalize(70), }, postContainer: { - height: ITEM_HEIGHT, - width: SCREEN_WIDTH, flex: 1, }, postHeader: { |