Skip to content

Commit f8768d6

Browse files
fix(mobile): use the Android sheet header for Add environment (#23452)
Co-authored-by: maria-rcks <[email protected]>
1 parent 6ad0827 commit f8768d6

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

‎apps/mobile/src/Stack.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
10061006
...HORIZONTAL_FORM_SHEET_OPTIONS,
10071007
sheetAllowedDetents: [0.55, 0.7],
10081008
sheetGrabberVisible: true,
1009+
sheetCornerRadius: Platform.OS === "android" ? 28 : undefined,
10091010
},
10101011
}),
10111012
NotFound: createNativeStackScreen({

‎apps/mobile/src/features/settings/components/SettingsScreen.tsx‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useNavigation, useRoute } from "@react-navigation/native";
22
import type { ReactNode } from "react";
33
import { Platform, View } from "react-native";
44

5+
import { AndroidSheetHeader } from "../../../components/ui/AndroidScreenHeader";
56
import type { AppBarProps } from "../../../components/ui/AppBar.types";
67
import { AppBar } from "../../../components/ui/AppBar";
78
import { ScreenContent as SettingsScreenContent } from "../../../components/ui/ScreenContent";
@@ -43,18 +44,28 @@ export function SettingsScreen(
4344

4445
return (
4546
<View collapsable={false} className={`flex-1 ${surfaceClassName}`}>
46-
<AppBar
47-
title={props.title}
48-
actions={props.actions}
49-
search={props.search}
50-
trailing={Platform.OS === "android" ? props.trailing : undefined}
51-
sidebar={false}
52-
onBack={workspaceRoot ? undefined : () => navigation.goBack()}
53-
hideBottomBorder={!props.formSheet}
54-
/>
47+
{Platform.OS === "android" && props.formSheet ? (
48+
<AndroidSheetHeader
49+
title={props.title}
50+
actions={props.actions}
51+
trailing={props.trailing}
52+
onBack={() => navigation.goBack()}
53+
hideBottomBorder
54+
/>
55+
) : (
56+
<AppBar
57+
title={props.title}
58+
actions={props.actions}
59+
search={props.search}
60+
trailing={Platform.OS === "android" ? props.trailing : undefined}
61+
sidebar={false}
62+
onBack={workspaceRoot ? undefined : () => navigation.goBack()}
63+
hideBottomBorder={!props.formSheet}
64+
/>
65+
)}
5566
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
5667
<ScreenScrollViewSurface value={surfaceClassName}>
57-
{props.formSheet ? (
68+
{props.formSheet && Platform.OS !== "android" ? (
5869
props.children
5970
) : (
6071
<SettingsScreenContent

0 commit comments

Comments
 (0)