diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-07 16:07:56 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-08 16:18:34 -0400 |
commit | d71a4d178715d34570d949e0cd0c1c58186715fc (patch) | |
tree | 5b1bcd42ac49eb9fb7718ed9fbe0d618c39201c6 /src | |
parent | f52f6eaa57250a3eb5cf50dab393c5ec29f4d688 (diff) |
Adjust header height
Diffstat (limited to 'src')
-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: { |