Fix React hook violations and optimize component behavior

Update form state management in AddEventModal and improve GoogleTab OAuth handling

Refactor EventListScreen to remove unused state calculation

Add missing dependencies in JourneyList useMemo hooks

Simplify events store initialization in EventsProvider
This commit is contained in:
2026-05-18 21:56:11 +02:00
parent b240d638ef
commit 9c1f6ebf7e
7 changed files with 48 additions and 47 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ const byPrefixAndName = { fas: { bars: faBars } };
type HeaderMenuProps = {
navigation: {
navigate: (screen: 'CalendarImport' | 'Settings') => void;
navigate: (_screen: 'CalendarImport' | 'Settings') => void;
};
};
@@ -61,7 +61,7 @@ function CalendarCheckbox({
}: {
calendar: SelectableCalendar;
selected: boolean;
onToggle: (id: string) => void;
onToggle: (_id: string) => void;
colors: ReturnType<typeof useColors>;
}) {
const badgeColor = BADGE_COLORS[calendar.accountType] ?? BADGE_COLORS.other;
@@ -178,13 +178,6 @@ export function EventListScreen({ navigation }: ScreenProps) {
const leaveCountdownLabel = leaveCountdown?.label;
const leaveByLabel = leaveBy ? formatTime(leaveBy) : null;
const trainLabel = selectedJourney?.trains.length ? selectedJourney.trains.join(', ') : 'Searching for train connection';
const status = leaveCountdown
? leaveCountdown.label === 'Now'
? 'Leave now'
: `Leave in ${leaveCountdown.label}`
: journeysLoading || destStation.loading
? 'Calculating departure time'
: 'No connection';
return (
<View style={styles.cardWrapper}>