fix(mobile): add compose to the single-column iPad list (#18157)
This commit is contained in:
1 file changed
+25
-9
@@ -19,13 +19,14 @@ export type { HomeHeaderEnvironment } from "./HomeHeader.types";
|
||||
|
||||
export function HomeHeader(props: HomeHeaderProps) {
|
||||
const navigation = useNavigation<NativeStackNavigationProp<ParamListBase>>();
|
||||
const { panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
|
||||
const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
|
||||
const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
|
||||
const primaryColumn = use(NativePrimaryColumnContext);
|
||||
const sidebarHeader =
|
||||
Platform.OS === "ios" &&
|
||||
primaryColumn !== null &&
|
||||
(Platform.isPad || !usesNativeMailSearchToolbar);
|
||||
const showsCompactCompose = Platform.OS === "ios" && Platform.isPad && !layout.usesSplitView;
|
||||
const searchBarRef = useRef<SearchBarCommands>(null);
|
||||
const focusAfterReveal = useRef(false);
|
||||
useEffect(
|
||||
@@ -59,20 +60,35 @@ export function HomeHeader(props: HomeHeaderProps) {
|
||||
return (
|
||||
<>
|
||||
<NativeStackScreenOptions
|
||||
optionsVersion={filterMenu.items}
|
||||
optionsVersion={[filterMenu.items, showsCompactCompose]}
|
||||
options={{
|
||||
// Static header config (glass, title, fonts) lives in Stack.tsx
|
||||
// (GLASS_HEADER_OPTIONS). Only dynamic values are set here.
|
||||
headerTintColor: iconColor,
|
||||
unstable_headerRightItems: () =>
|
||||
sidebarHeader
|
||||
? createSidebarHeaderItems({
|
||||
filterIcon: hasCustomListOptions
|
||||
? "line.3.horizontal.decrease.circle.fill"
|
||||
: "line.3.horizontal.decrease.circle",
|
||||
filterMenu,
|
||||
onOpenSettings: props.onOpenSettings,
|
||||
})
|
||||
? [
|
||||
...createSidebarHeaderItems({
|
||||
filterIcon: hasCustomListOptions
|
||||
? "line.3.horizontal.decrease.circle.fill"
|
||||
: "line.3.horizontal.decrease.circle",
|
||||
filterMenu,
|
||||
onOpenSettings: props.onOpenSettings,
|
||||
}),
|
||||
...(showsCompactCompose
|
||||
? [
|
||||
withNativeGlassHeaderItem({
|
||||
accessibilityLabel: "New task",
|
||||
axisBehavior: "horizontalOnly",
|
||||
icon: { name: "square.and.pencil", type: "sfSymbol" } as const,
|
||||
identifier: "home-new-task",
|
||||
label: "",
|
||||
onPress: props.onStartNewTask,
|
||||
type: "button",
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
]
|
||||
: [
|
||||
withNativeGlassHeaderItem({
|
||||
accessibilityLabel: "Open settings",
|
||||
|
||||
Reference in new issue
Block a user