fix(native): add change password screen and update navigation

Implement a new Change Password screen with form validation and user feedback. Adjust navigation to include the change password option in the settings. Update the layout to present the change password screen as a modal on Android and a form sheet on iOS. Clean up previous settings layout code by removing redundant options.
This commit is contained in:
2026-03-16 10:49:40 -04:00
parent 8dfa54a60c
commit 639fa34585
4 changed files with 27 additions and 26 deletions
@@ -2,29 +2,5 @@ import { Stack } from "expo-router";
import { useTabScreenOptions } from "@/hooks/use-tab-screen-options"; import { useTabScreenOptions } from "@/hooks/use-tab-screen-options";
export default function SettingsLayout() { export default function SettingsLayout() {
const screenOptions = useTabScreenOptions(); return <Stack screenOptions={useTabScreenOptions()} />;
const changePasswordOptions =
process.env.EXPO_OS === "ios"
? {
presentation: "formSheet" as const,
sheetAllowedDetents: "fitToContents" as const,
sheetGrabberVisible: true,
headerLargeTitle: false,
headerTransparent: false,
headerBlurEffect: "none" as const,
unstable_headerRightItems: () => [],
}
: {
presentation: "modal" as const,
headerLargeTitle: false,
headerTransparent: false,
headerBlurEffect: "none" as const,
unstable_headerRightItems: () => [],
};
return (
<Stack screenOptions={screenOptions}>
<Stack.Screen name="change-password" options={changePasswordOptions} />
</Stack>
);
} }
@@ -351,7 +351,7 @@ export default function SettingsScreen() {
<SettingsRow <SettingsRow
label={hasPassword ? "Change password" : "Set password"} label={hasPassword ? "Change password" : "Set password"}
icon={IconLock} icon={IconLock}
onPress={() => push("/(tabs)/(settings)/change-password")} onPress={() => push("/change-password")}
/> />
)} )}
+25
View File
@@ -64,6 +64,27 @@ export const unstable_settings = {
initialRouteName: "(tabs)", initialRouteName: "(tabs)",
}; };
const changePasswordOptions =
process.env.EXPO_OS === "ios"
? {
title: "Change Password",
headerShown: true,
presentation: "formSheet" as const,
sheetAllowedDetents: "fitToContents" as const,
sheetGrabberVisible: true,
headerLargeTitle: false,
headerTransparent: false,
headerBlurEffect: "none" as const,
}
: {
title: "Change Password",
headerShown: true,
presentation: "modal" as const,
headerLargeTitle: false,
headerTransparent: false,
headerBlurEffect: "none" as const,
};
function AppContent() { function AppContent() {
const contentStyle = useResolveClassNames("bg-background"); const contentStyle = useResolveClassNames("bg-background");
@@ -209,6 +230,10 @@ function AppContent() {
<Stack.Protected guard={!!session}> <Stack.Protected guard={!!session}>
<Stack.Screen name="(tabs)" /> <Stack.Screen name="(tabs)" />
<Stack.Screen
name="change-password"
options={changePasswordOptions}
/>
<Stack.Screen <Stack.Screen
name="title/[id]" name="title/[id]"
dangerouslySingular dangerouslySingular