trails/apps/mobile/app/_layout.tsx
Ullrich Schäfer bdde95e69b
Use @gorhom/bottom-sheet for waypoint sheet
Replace custom View-based bottom sheet with @gorhom/bottom-sheet:
- Native gesture-driven drag, snap points, pan-down-to-close
- Proper safe area handling built in
- Wrap app with GestureHandlerRootView
- Add react-native-reanimated plugin to Expo config

Adds react-native-reanimated and react-native-gesture-handler as
native dependencies (requires new EAS build).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 01:09:13 +02:00

33 lines
842 B
TypeScript

import { useEffect, useState } from "react";
import { Stack, router } from "expo-router";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { Sentry, initSentry } from "../lib/sentry";
import { isAuthenticated } from "../lib/auth";
import { startVersionCheck } from "../lib/version-check";
initSentry();
function RootLayout() {
const [checked, setChecked] = useState(false);
useEffect(() => {
isAuthenticated().then((authed) => {
if (!authed) {
router.replace("/login");
} else {
startVersionCheck();
}
setChecked(true);
});
}, []);
if (!checked) return null;
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<Stack screenOptions={{ headerShown: false }} />
</GestureHandlerRootView>
);
}
export default Sentry.wrap(RootLayout);