Compare commits

..

No commits in common. "ab90b944aef714bd682ffa301c2ce3d1b235ec7a" and "09ae4f0eaaa1bdbbf6d7f51f433014857844abdb" have entirely different histories.

6 changed files with 46 additions and 94 deletions

View File

@ -1,10 +1,3 @@
# [2.16.0](https://github.com/kolplattformen/skolplattformen/compare/v2.15.10...v2.16.0) (2023-11-02)
### Features
* navigate from "Your Children" to specific tabs ([#660](https://github.com/kolplattformen/skolplattformen/issues/660)) ([34c376a](https://github.com/kolplattformen/skolplattformen/commit/34c376a727ad0bbfbd3f7be01aedb91d1705b34b))
## [2.15.10](https://github.com/kolplattformen/skolplattformen/compare/v2.15.9...v2.15.10) (2023-10-07)

View File

@ -139,10 +139,7 @@ const TabNavigator = ({
)
const getHeaderTitle = (route: any) => {
const routeName =
getFocusedRouteNameFromRoute(route) ??
route.params.initialRouteName ??
'News'
const routeName = getFocusedRouteNameFromRoute(route) ?? 'News'
return getRouteTitleFromName(routeName)
}

View File

@ -18,7 +18,7 @@ import {
} from '@ui-kitten/components'
import moment, { Moment } from 'moment'
import React, { useEffect } from 'react'
import { Pressable, useColorScheme, View } from 'react-native'
import { TouchableOpacity, useColorScheme, View } from 'react-native'
import { useTranslation } from '../hooks/useTranslation'
import { Colors, Layout, Sizing } from '../styles'
import { getMeaningfulStartingDate } from '../utils/calendarHelpers'
@ -157,15 +157,11 @@ export const ChildListItem = ({
)
return (
<View style={styles.card}>
<View style={styles.cardHeader}>
<Pressable
style={({ pressed }) => [
styles.cardHeaderLeft || {},
{ opacity: pressed ? 0.5 : 1 },
]}
onPress={() => navigation.navigate('Child', { child, color })}
>
<TouchableOpacity
onPress={() => navigation.navigate('Child', { child, color })}
>
<View style={styles.card}>
<View style={styles.cardHeader}>
<View style={styles.cardHeaderLeft}>
<StudentAvatar name={studentName(child.name)} color={color} />
<View style={styles.cardHeaderText}>
@ -182,37 +178,16 @@ export const ChildListItem = ({
name="star"
/>
</View>
</Pressable>
</View>
</View>
<Pressable
style={({ pressed }) => ['' || {}, { opacity: pressed ? 0.5 : 1 }]}
onPress={() =>
navigation.navigate('Child', {
child,
color,
initialRouteName: 'Calendar',
})
}
>
<DaySummary child={child} date={meaningfulStartingDate} />
{scheduleAndCalendarThisWeek.slice(0, 3).map((calendarItem, i) => (
<Text category="p1" key={i}>
{`${calendarItem.title} (${displayDate(calendarItem.startDate)})`}
</Text>
))}
</Pressable>
<Pressable
style={({ pressed }) => ['' || {}, { opacity: pressed ? 0.5 : 1 }]}
onPress={() =>
navigation.navigate('Child', {
child,
color,
initialRouteName: 'News',
})
}
>
<Text category="c2" style={styles.label}>
{t('navigation.news')}
</Text>
@ -227,52 +202,43 @@ export const ChildListItem = ({
{newsItem.header ?? ''}
</Text>
))}
</Pressable>
{scheduleAndCalendarThisWeek.length ||
notificationsThisWeek.length ||
newsThisWeek.length ? null : (
<Text category="p1" style={styles.noNewNewsItemsText}>
{t('news.noNewNewsItemsThisWeek')}
</Text>
)}
{shouldShowLunchMenu ? (
<Pressable
style={({ pressed }) => ['' || {}, { opacity: pressed ? 0.5 : 1 }]}
onPress={() =>
navigation.navigate('Child', {
child,
color,
initialRouteName: 'Menu',
})
}
>
<Text category="c2" style={styles.label}>
{meaningfulStartingDate.format(
'[' + t('schedule.lunch') + '] dddd'
)}
{scheduleAndCalendarThisWeek.length ||
notificationsThisWeek.length ||
newsThisWeek.length ? null : (
<Text category="p1" style={styles.noNewNewsItemsText}>
{t('news.noNewNewsItemsThisWeek')}
</Text>
<Text>
{menu[meaningfulStartingDate.isoWeekday() - 1]?.description}
</Text>
</Pressable>
) : null}
)}
{shouldShowLunchMenu ? (
<>
<Text category="c2" style={styles.label}>
{meaningfulStartingDate.format(
'[' + t('schedule.lunch') + '] dddd'
)}
</Text>
<Text>
{menu[meaningfulStartingDate.isoWeekday() - 1]?.description}
</Text>
</>
) : null}
<View style={styles.itemFooter}>
<Button
accessible
accessibilityRole="button"
accessibilityLabel={`${child.name}, ${t('abscense.title')}`}
appearance="ghost"
accessoryLeft={AlertIcon}
status="primary"
style={styles.absenceButton}
onPress={() => navigation.navigate('Absence', { child })}
>
{t('abscense.title')}
</Button>
<View style={styles.itemFooter}>
<Button
accessible
accessibilityRole="button"
accessibilityLabel={`${child.name}, ${t('abscense.title')}`}
appearance="ghost"
accessoryLeft={AlertIcon}
status="primary"
style={styles.absenceButton}
onPress={() => navigation.navigate('Absence', { child })}
>
{t('abscense.title')}
</Button>
</View>
</View>
</View>
</TouchableOpacity>
)
}

View File

@ -19,11 +19,7 @@ export const NavigationTitle = ({ title, subtitle }: NavigationTitleProps) => {
{title}
</Text>
)}
{subtitle && (
<Text style={styles.subtitle}>
{subtitle.substring(0, subtitle.indexOf(' '))}
</Text>
)}
{subtitle && <Text style={styles.subtitle}>{subtitle}</Text>}
</View>
)
}
@ -36,5 +32,5 @@ const styles = StyleSheet.create({
...fontSize.sm,
fontWeight: '500',
},
subtitle: { ...fontSize.base },
subtitle: { ...fontSize.xxs },
})

View File

@ -49,7 +49,7 @@ For more information, please visit [CocoaPods Getting Started guide](https://gui
### Running on a device
The above command will automatically run your app on the iOS Simulator by default. If you want to run the app on an actual physical iOS device, please follow the instructions [here](https://reactnative.dev/docs/running-on-device).
The above command will automatically run your app on the iOS Simulator by default. If you want to run the app on an actual physical iOS device, please follow the instructions [here](https://reactnative.dev/docs/running-on-device.
## Running the app

View File

@ -1,6 +1,6 @@
{
"name": "skolplattformen",
"version": "2.16.0",
"version": "2.15.10",
"license": "MIT",
"scripts": {
"start": "nx start",