Skip to content

Commit

Permalink
Revert "feat (navigate to specific tabs from childlist)"
Browse files Browse the repository at this point in the history
This reverts commit 8af0689.
  • Loading branch information
PalmN72 committed Oct 9, 2023
1 parent f4a6b60 commit 44f695b
Showing 1 changed file with 36 additions and 80 deletions.
116 changes: 36 additions & 80 deletions apps/skolplattformen-app/components/childListItem.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@ui-kitten/components'
import moment, { Moment } from 'moment'
import React, { useEffect } from 'react'
import { TouchableOpacity, useColorScheme, View, Pressable } 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'
Expand Down Expand Up @@ -162,81 +162,46 @@ export const ChildListItem = ({
>
<View style={styles.card}>
<View style={styles.cardHeader}>
<Pressable
style={({ pressed }) => [
styles.cardHeader || {},
{ opacity: pressed ? 0.5 : 1 },
]}
onPress={() =>
navigation.navigate('Child', {
child,
color,
})
}
>
<View style={styles.cardHeaderLeft}>
<StudentAvatar name={studentName(child.name)} color={color} />
<View style={styles.cardHeaderText}>
<Text category="h6">{studentName(child.name)}</Text>
{className ? <Text category="s1">{className}</Text> : null}
</View>
</View>
<View style={styles.cardHeaderRight}>
<RightArrowIcon
style={styles.icon}
fill={
isDarkMode ? Colors.neutral.gray200 : Colors.neutral.gray800
}
name="star"
/>
<View style={styles.cardHeaderLeft}>
<StudentAvatar name={studentName(child.name)} color={color} />
<View style={styles.cardHeaderText}>
<Text category="h6">{studentName(child.name)}</Text>
{className ? <Text category="s1">{className}</Text> : null}
</View>
</Pressable>
</View>
<View style={styles.cardHeaderRight}>
<RightArrowIcon
style={styles.icon}
fill={
isDarkMode ? Colors.neutral.gray200 : Colors.neutral.gray800
}
name="star"
/>
</View>
</View>

<Pressable
style={({ pressed }) => ['' || {}, { opacity: pressed ? 0.5 : 1 }]}
onPress={() =>
navigation.navigate('Child', {
child,
color,
initialRouteName: 'Calendar',
})
}
>
<DaySummary child={child} date={meaningfulStartingDate} />
<DaySummary child={child} date={meaningfulStartingDate} />

{scheduleAndCalendarThisWeek.slice(0, 3).map((calendarItem, i) => (
<Text category="p1" key={i}>
{`${calendarItem.title} (${displayDate(calendarItem.startDate)})`}
</Text>
))}
</Pressable>
{scheduleAndCalendarThisWeek.slice(0, 3).map((calendarItem, i) => (
<Text category="p1" key={i}>
{`${calendarItem.title} (${displayDate(calendarItem.startDate)})`}
</Text>
))}

<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 category="c2" style={styles.label}>
{t('navigation.news')}
</Text>
{notificationsThisWeek.slice(0, 3).map((notification, i) => (
<Text category="p1" key={i}>
{notification.message}
</Text>
{notificationsThisWeek.slice(0, 3).map((notification, i) => (
<Text category="p1" key={i}>
{notification.message}
</Text>
))}
))}

{newsThisWeek.slice(0, 3).map((newsItem, i) => (
<Text category="p1" key={i}>
{newsItem.header ?? ''}
</Text>
))}
</Pressable>
{newsThisWeek.slice(0, 3).map((newsItem, i) => (
<Text category="p1" key={i}>
{newsItem.header ?? ''}
</Text>
))}

{scheduleAndCalendarThisWeek.length ||
notificationsThisWeek.length ||
Expand All @@ -246,16 +211,7 @@ export const ChildListItem = ({
</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'
Expand All @@ -264,7 +220,7 @@ export const ChildListItem = ({
<Text>
{menu[meaningfulStartingDate.isoWeekday() - 1]?.description}
</Text>
</Pressable>
</>
) : null}

<View style={styles.itemFooter}>
Expand Down

0 comments on commit 44f695b

Please sign in to comment.