Skip to content
TypeScript

fix(mobile): use the Android sheet header for Add environment (#23452)

Alexf8768d68b6e2
diff --git a/apps/mobile/src/Stack.tsx b/apps/mobile/src/Stack.tsx
index 7a0042903a3..872ca142c8a 100644
--- a/apps/mobile/src/Stack.tsx
+++ b/apps/mobile/src/Stack.tsx
@@ -1006,6 +1006,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
...HORIZONTAL_FORM_SHEET_OPTIONS,
sheetAllowedDetents: [0.55, 0.7],
sheetGrabberVisible: true,
+ sheetCornerRadius: Platform.OS === "android" ? 28 : undefined,
},
}),
NotFound: createNativeStackScreen({
diff --git a/apps/mobile/src/features/settings/components/SettingsScreen.tsx b/apps/mobile/src/features/settings/components/SettingsScreen.tsx
index 05b267242d4..b61a57c8b75 100644
--- a/apps/mobile/src/features/settings/components/SettingsScreen.tsx
+++ b/apps/mobile/src/features/settings/components/SettingsScreen.tsx
@@ -2,6 +2,7 @@ import { useNavigation, useRoute } from "@react-navigation/native";
import type { ReactNode } from "react";
import { Platform, View } from "react-native";
+import { AndroidSheetHeader } from "../../../components/ui/AndroidScreenHeader";
import type { AppBarProps } from "../../../components/ui/AppBar.types";
import { AppBar } from "../../../components/ui/AppBar";
import { ScreenContent as SettingsScreenContent } from "../../../components/ui/ScreenContent";
@@ -43,18 +44,28 @@ export function SettingsScreen(
return (
<View collapsable={false} className={`flex-1 ${surfaceClassName}`}>
- <AppBar
- title={props.title}
- actions={props.actions}
- search={props.search}
- trailing={Platform.OS === "android" ? props.trailing : undefined}
- sidebar={false}
- onBack={workspaceRoot ? undefined : () => navigation.goBack()}
- hideBottomBorder={!props.formSheet}
- />
+ {Platform.OS === "android" && props.formSheet ? (
+ <AndroidSheetHeader
+ title={props.title}
+ actions={props.actions}
+ trailing={props.trailing}
+ onBack={() => navigation.goBack()}
+ hideBottomBorder
+ />
+ ) : (
+ <AppBar
+ title={props.title}
+ actions={props.actions}
+ search={props.search}
+ trailing={Platform.OS === "android" ? props.trailing : undefined}
+ sidebar={false}
+ onBack={workspaceRoot ? undefined : () => navigation.goBack()}
+ hideBottomBorder={!props.formSheet}
+ />
+ )}
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
<ScreenScrollViewSurface value={surfaceClassName}>
- {props.formSheet ? (
+ {props.formSheet && Platform.OS !== "android" ? (
props.children
) : (
<SettingsScreenContent