diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-29 14:02:59 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-29 14:05:22 -0400 |
commit | 4cd0910e9b20b10b0a5ef46945b139e711eec252 (patch) | |
tree | 2af4cb30729879c5b6d209533c11d11f07b82b08 /src | |
parent | 97b7c29fe22f0d31a1a6b095de0ea76a3067e115 (diff) |
Fix header styling
Diffstat (limited to 'src')
-rw-r--r-- | src/components/moments/MomentPost.tsx | 36 | ||||
-rw-r--r-- | src/routes/main/MainStackScreen.tsx | 3 |
2 files changed, 37 insertions, 2 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 123ee5f4..ecd2e66f 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -34,6 +34,7 @@ import {RootState} from '../../store/rootReducer'; import {MomentPostType, MomentTagType, ScreenType, UserType} from '../../types'; import { getTimePosted, + isIPhoneX, navigateToProfile, normalize, SCREEN_HEIGHT, @@ -133,7 +134,22 @@ const MomentPost: React.FC<MomentPostProps> = ({ useEffect( () => navigation.setOptions({ - ...headerBarOptions('white', moment.moment_category), + ...headerBarOptions('white', ''), + headerTitle: () => ( + <Text + numberOfLines={3} + style={[ + styles.multilineHeaderTitle, + { + fontSize: + moment.moment_category.length > 18 + ? normalize(14) + : normalize(16), + }, + ]}> + {moment.moment_category} + </Text> + ), }), [moment.moment_id], ); @@ -499,7 +515,23 @@ const styles = StyleSheet.create({ position: 'absolute', top: -2.5, }, - profilePreviewContainer: {paddingHorizontal: '3%'}, + progressBaContainer: { + position: 'absolute', + top: isIPhoneX() ? 75 : 70, + }, + profilePreviewContainer: { + paddingHorizontal: '3%', + }, + multilineHeaderTitle: { + width: SCREEN_WIDTH * 0.7, + height: normalize(70), + marginTop: normalize(90) / 2, + textAlign: 'center', + lineHeight: normalize(21.48), + letterSpacing: normalize(1.3), + fontWeight: '700', + color: 'white', + }, }); export default MomentPost; diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx index ccfc4cbd..35e1f8e0 100644 --- a/src/routes/main/MainStackScreen.tsx +++ b/src/routes/main/MainStackScreen.tsx @@ -382,6 +382,7 @@ export const headerBarOptions: ( ), headerTitle: () => ( <Text + numberOfLines={1} style={[ styles.headerTitle, {color: color}, @@ -417,7 +418,9 @@ const styles = StyleSheet.create({ shadowOffset: {width: 0, height: 0}, }, headerTitle: { + width: SCREEN_WIDTH * 0.7, textAlign: 'center', + lineHeight: normalize(21.48), letterSpacing: normalize(1.3), fontWeight: '700', }, |