mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat(companion): add configurable landing page feature - Add useUserPreferences hook for persistent storage of landing page preference - Add LandingPagePicker component for both iOS and Android/web platforms - Update tabs index to redirect based on user preference - Update bookings index to accept initial filter from URL params - Add App Settings section in More screen with landing page selector - Clear user preferences on logout for fresh state * fix(companion): remove try-finally for React Compiler compatibility * fix(companion): use router.replace for dynamic landing page redirect Replace Redirect component with router.replace() to fix TypeScript strict typing issue with expo-router's Href type for dynamic routes. * fix(companion): use literal route strings for TypeScript strict typing Use switch statement with literal route strings instead of dynamic string variable to satisfy expo-router's strict Href type checking. * working fix * better css
22 lines
799 B
TypeScript
22 lines
799 B
TypeScript
import { Redirect } from "expo-router";
|
|
import { ActivityIndicator, View } from "react-native";
|
|
import { getRouteFromPreference, useUserPreferences } from "@/hooks/useUserPreferences";
|
|
|
|
export default function TabsIndex() {
|
|
const { preferences, isLoading } = useUserPreferences();
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<View className="flex-1 items-center justify-center bg-white">
|
|
<ActivityIndicator size="small" color="#111827" />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const route = getRouteFromPreference(preferences.landingPage);
|
|
console.log("[TabsIndex] Redirecting to:", route, "from preference:", preferences.landingPage);
|
|
|
|
// biome-ignore lint/suspicious/noExplicitAny: expo-router types don't support dynamic route strings from preferences
|
|
return <Redirect href={route as any} />;
|
|
}
|