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>
This commit is contained in:
parent
fe07fbdf59
commit
bdde95e69b
6 changed files with 782 additions and 250 deletions
|
|
@ -1,5 +1,6 @@
|
|||
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";
|
||||
|
|
@ -22,7 +23,11 @@ function RootLayout() {
|
|||
|
||||
if (!checked) return null;
|
||||
|
||||
return <Stack screenOptions={{ headerShown: false }} />;
|
||||
return (
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
<Stack screenOptions={{ headerShown: false }} />
|
||||
</GestureHandlerRootView>
|
||||
);
|
||||
}
|
||||
|
||||
export default Sentry.wrap(RootLayout);
|
||||
|
|
|
|||
|
|
@ -172,15 +172,13 @@ function RouteDetailContent({ route }: { route: RouteDetail }) {
|
|||
)}
|
||||
|
||||
{selectedWaypoint !== null && editor.waypoints[selectedWaypoint] && (
|
||||
<View style={[styles.sheetOverlay, { paddingBottom: insets.bottom }]}>
|
||||
<WaypointSheet
|
||||
waypoint={editor.waypoints[selectedWaypoint]!}
|
||||
index={selectedWaypoint}
|
||||
onClose={() => setSelectedWaypoint(null)}
|
||||
onDelete={editor.deleteWaypoint}
|
||||
onToggleOvernight={editor.toggleOvernight}
|
||||
/>
|
||||
</View>
|
||||
<WaypointSheet
|
||||
waypoint={editor.waypoints[selectedWaypoint]!}
|
||||
index={selectedWaypoint}
|
||||
onClose={() => setSelectedWaypoint(null)}
|
||||
onDelete={editor.deleteWaypoint}
|
||||
onToggleOvernight={editor.toggleOvernight}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
) : (
|
||||
|
|
@ -253,5 +251,4 @@ const styles = StyleSheet.create({
|
|||
actionSecondaryText: { color: "#333", fontSize: 16, fontWeight: "600" },
|
||||
errorBanner: { position: "absolute", bottom: 16, alignSelf: "center", backgroundColor: "rgba(220,38,38,0.9)", borderRadius: 8, paddingVertical: 8, paddingHorizontal: 16 },
|
||||
errorBannerText: { color: "#fff", fontSize: 13 },
|
||||
sheetOverlay: { position: "absolute", bottom: 0, left: 0, right: 0 },
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue