Skip to content

Commit 6d8f16e

Browse files
committed
fix(mobile): use the Android sheet header for Add environment
1 parent defb7e6 commit 6d8f16e

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

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

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useNavigation, useNavigationState, useRoute } from "@react-navigation/n
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";
@@ -25,15 +26,25 @@ export function SettingsScreen(
2526

2627
return (
2728
<View collapsable={false} className="flex-1 bg-sheet">
28-
<AppBar
29-
title={props.title}
30-
actions={props.actions}
31-
trailing={Platform.OS === "android" ? props.trailing : undefined}
32-
sidebar={false}
33-
onBack={workspaceRoot ? undefined : () => navigation.goBack()}
34-
hideBottomBorder={!props.formSheet}
35-
/>
36-
{props.formSheet ? (
29+
{Platform.OS === "android" && props.formSheet ? (
30+
<AndroidSheetHeader
31+
title={props.title}
32+
actions={props.actions}
33+
trailing={props.trailing}
34+
onBack={() => navigation.goBack()}
35+
hideBottomBorder
36+
/>
37+
) : (
38+
<AppBar
39+
title={props.title}
40+
actions={props.actions}
41+
trailing={Platform.OS === "android" ? props.trailing : undefined}
42+
sidebar={false}
43+
onBack={workspaceRoot ? undefined : () => navigation.goBack()}
44+
hideBottomBorder={!props.formSheet}
45+
/>
46+
)}
47+
{props.formSheet && Platform.OS !== "android" ? (
3748
props.children
3849
) : (
3950
<SettingsScreenContent>{props.children}</SettingsScreenContent>

0 commit comments

Comments
 (0)