Skip to content

Commit eb80365

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-14393
2 parents 156cb9d + 5b15cfc commit eb80365

13 files changed

Lines changed: 580 additions & 318 deletions
-771 KB
Binary file not shown.
774 KB
Binary file not shown.

‎apps/mobile/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"react-native-pdf-jsi": "5.0.0",
128128
"react-native-reanimated": "4.7.1",
129129
"react-native-safe-area-context": "~5.10.1",
130-
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.45.tgz",
130+
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.48.tgz",
131131
"react-native-svg": "15.16.0",
132132
"react-native-webview": "14.0.1",
133133
"react-native-worklets": "0.13.0",

‎apps/mobile/src/components/ui/AndroidScreenHeader.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AppActivityIndicator } from "./AppActivityIndicator";
22
import { Column, Row, Text as NativeText, RNHostView } from "@expo/ui/jetpack-compose";
33
import { weight } from "@expo/ui/jetpack-compose/modifiers";
4-
import { useState, type ReactNode } from "react";
4+
import { use, useState, type ReactNode } from "react";
55
import { View } from "react-native";
66

77
import type { AppSymbolName } from "./AppSymbol";
@@ -12,6 +12,7 @@ import { splitAndroidHeaderActions } from "./headerMenu.android";
1212
import { useScaledTextRole } from "../../features/settings/appearance/useScaledTextRole";
1313
import { useToolbarLayout } from "./useToolbarLayout";
1414
import { useControlTheme } from "./useControlTheme";
15+
import { RoutedFormSheetContext } from "./RoutedFormSheetContext";
1516

1617
export interface AndroidHeaderAction {
1718
readonly accessibilityLabel: string;
@@ -50,7 +51,8 @@ export function AndroidScreenHeader(props: {
5051
const { colors } = useControlTheme();
5152
const titleTypography = useScaledTextRole("title");
5253
const subtitleTypography = useScaledTextRole("label");
53-
const { paddingTop, paddingBottom } = useToolbarLayout(props.embedded);
54+
const inFormSheet = use(RoutedFormSheetContext);
55+
const { paddingTop, paddingBottom } = useToolbarLayout(props.embedded || inFormSheet);
5456
const [headerWidth, setHeaderWidth] = useState(0);
5557
const { visibleActions, overflowActions } = splitAndroidHeaderActions(
5658
props.actions ?? [],
@@ -67,6 +69,12 @@ export function AndroidScreenHeader(props: {
6769
borderBottomWidth: props.hideBottomBorder ? 0 : undefined,
6870
}}
6971
>
72+
{inFormSheet ? (
73+
<View
74+
pointerEvents="none"
75+
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
76+
/>
77+
) : null}
7078
<NativeAppBar
7179
singleLine={props.compact}
7280
navigationIcon={
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createContext } from "react";
2+
3+
export const RoutedFormSheetContext = createContext(false);

‎apps/mobile/src/components/ui/Sheet.android.tsx‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { View } from "react-native";
33
import { FormSheet } from "react-native-screens";
44
import { useResolveClassNames } from "uniwind";
55
import { AndroidSheetHeader } from "./AndroidScreenHeader";
6+
import { RoutedFormSheetContext } from "./RoutedFormSheetContext";
67
import { ScreenContent } from "./ScreenContent";
78
import type { SheetProps } from "./Sheet.types";
89
export type { SheetProps } from "./Sheet.types";
@@ -19,15 +20,21 @@ export function Sheet(props: SheetProps) {
1920
onDismiss={props.onClose}
2021
onNativeDismiss={props.onClose}
2122
>
22-
{/* Android FormSheet does not bound flex children. Material drags target the first scroll view, so place content before the header. */}
23-
<View collapsable={false} className="absolute inset-0 flex-col-reverse bg-header">
24-
<ScreenContent>{props.children}</ScreenContent>
25-
<AndroidSheetHeader title={props.title} onBack={() => setIsOpen(false)} hideBottomBorder />
26-
<View
27-
pointerEvents="none"
28-
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
29-
/>
30-
</View>
23+
<RoutedFormSheetContext value={false}>
24+
{/* Android FormSheet does not bound flex children. Material drags target the first scroll view, so place content before the header. */}
25+
<View collapsable={false} className="absolute inset-0 flex-col-reverse bg-header">
26+
<ScreenContent>{props.children}</ScreenContent>
27+
<AndroidSheetHeader
28+
title={props.title}
29+
onBack={() => setIsOpen(false)}
30+
hideBottomBorder
31+
/>
32+
<View
33+
pointerEvents="none"
34+
className="absolute top-1 h-1 w-8 self-center rounded-full bg-header-foreground/40"
35+
/>
36+
</View>
37+
</RoutedFormSheetContext>
3138
</FormSheet>
3239
);
3340
}

0 commit comments

Comments
 (0)