Skip to content

Commit

Permalink
fix: 🐛 Fixes news title, lowered font size on header
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorlarsson committed Nov 30, 2021
1 parent 33440bc commit 7df15d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ interface NavigationTitleProps {
export const NavigationTitle = ({ title, subtitle }: NavigationTitleProps) => {
return (
<View style={styles.container}>
<Text style={styles.title}>{title}</Text>
{title && (
<Text style={styles.title} numberOfLines={1} ellipsizeMode="tail">
{title}
</Text>
)}
<Text style={styles.subtitle}>{subtitle}</Text>
</View>
)
Expand All @@ -25,7 +29,7 @@ const styles = StyleSheet.create({
...Layout.center,
},
title: {
...fontSize.base,
...fontSize.sm,
fontWeight: '500',
},
subtitle: { ...fontSize.xxs },
Expand Down
8 changes: 4 additions & 4 deletions apps/skolplattformen-sthlm/components/newsItem.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export const newsItemRouteOptions =
return {
...defaultStackStyling(darkMode),
headerCenter: () => (
<NavigationTitle
title={newsItem.header}
subtitle={studentName(child?.name)}
/>
<NavigationTitle subtitle={studentName(child?.name)} />
),
headerLargeTitle: false,
}
Expand All @@ -58,6 +55,9 @@ export const NewsItem = ({ route }: NewsItemProps) => {
contentContainerStyle={styles.article}
style={styles.scrollView}
>
<Text maxFontSizeMultiplier={2} style={styles.title}>
{newsItem.header}
</Text>
{dateIsValid(newsItem.published) && (
<Text
maxFontSizeMultiplier={2}
Expand Down

0 comments on commit 7df15d3

Please sign in to comment.