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:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user