aboutsummaryrefslogtreecommitdiff
path: root/src/routes/main/MainStackScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-29 14:27:45 -0400
committerIvan Chen <ivan@tagg.id>2021-07-29 14:27:45 -0400
commit7c33718ecf68982b362f0756fe3df793ce97f6fd (patch)
treec44da71f70ea741f18b86258492607900b9d6a7a /src/routes/main/MainStackScreen.tsx
parent2947fb74da4f990ac9c15cb352ef254592a3c6ab (diff)
Cleaned up logic, Add logic to check if long title
Diffstat (limited to 'src/routes/main/MainStackScreen.tsx')
-rw-r--r--src/routes/main/MainStackScreen.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx
index 35e1f8e0..64060554 100644
--- a/src/routes/main/MainStackScreen.tsx
+++ b/src/routes/main/MainStackScreen.tsx
@@ -393,6 +393,23 @@ export const headerBarOptions: (
),
});
+export const multilineHeaderTitle: (title: string) => StackNavigationOptions = (
+ title,
+) => ({
+ headerTitle: () => (
+ <Text
+ numberOfLines={3}
+ style={[
+ styles.multilineHeaderTitle,
+ {
+ fontSize: title.length > 18 ? normalize(14) : normalize(16),
+ },
+ ]}>
+ {title}
+ </Text>
+ ),
+});
+
export const modalStyle: StackNavigationOptions = {
cardStyle: {backgroundColor: 'rgba(80,80,80,0.6)'},
gestureDirection: 'vertical',
@@ -424,6 +441,16 @@ const styles = StyleSheet.create({
letterSpacing: normalize(1.3),
fontWeight: '700',
},
+ 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 MainStackScreen;