Use native scroll edge effects on list headers
This commit is contained in:
1 parent
dfbfc25a8f
commit
c77e6af72a
2 files changed
+7
No files matched your search
@@ -23,12 +23,15 @@ import { AppText as Text } from "../../components/AppText";
|
||||
import { ControlPillMenu } from "../../components/ControlPill";
|
||||
import { EmptyState } from "../../components/EmptyState";
|
||||
import { ProjectFavicon } from "../../components/ProjectFavicon";
|
||||
import { nativeHeaderScrollEdgeEffects } from "../../lib/native-scroll-edge-effect";
|
||||
import { relativeTime } from "../../lib/time";
|
||||
import { useThemeColor } from "../../lib/useThemeColor";
|
||||
import { ThreadSwipeable } from "../home/thread-swipe-actions";
|
||||
import { createNativeMailSearchToolbarItem } from "../layout/native-mail-search-toolbar";
|
||||
import type { ArchivedThreadGroup, ArchivedThreadSortOrder } from "./archivedThreadList";
|
||||
|
||||
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
|
||||
|
||||
export interface ArchivedThreadsHeaderEnvironment {
|
||||
readonly environmentId: EnvironmentId;
|
||||
readonly label: string;
|
||||
@@ -114,6 +117,7 @@ function ArchivedThreadsHeader(props: {
|
||||
headerTransparent: usesNativeChrome,
|
||||
headerStyle: usesNativeChrome ? { backgroundColor: "transparent" } : undefined,
|
||||
headerShadowVisible: usesNativeChrome ? false : undefined,
|
||||
scrollEdgeEffects: usesNativeChrome ? HEADER_SCROLL_EDGE_EFFECTS : undefined,
|
||||
unstable_navigationItemStyle: usesNativeChrome ? "editor" : undefined,
|
||||
unstable_headerToolbarItems: usesCompactMailToolbar
|
||||
? () => [
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useCallback, useRef } from "react";
|
||||
import { Platform } from "react-native";
|
||||
import type { SearchBarCommands } from "react-native-screens";
|
||||
|
||||
import { nativeHeaderScrollEdgeEffects } from "../../lib/native-scroll-edge-effect";
|
||||
import { useThemeColor } from "../../lib/useThemeColor";
|
||||
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
|
||||
import { createNativeMailSearchToolbarItem } from "../layout/native-mail-search-toolbar";
|
||||
@@ -24,6 +25,7 @@ import {
|
||||
} from "./home-list-options";
|
||||
|
||||
export type HomeHeaderEnvironment = HomeListFilterMenuEnvironment;
|
||||
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
|
||||
|
||||
export function HomeHeader(props: {
|
||||
readonly environments: ReadonlyArray<HomeHeaderEnvironment>;
|
||||
@@ -59,6 +61,7 @@ export function HomeHeader(props: {
|
||||
headerLargeTitle: false,
|
||||
headerStyle: { backgroundColor: "transparent" },
|
||||
headerTintColor: iconColor,
|
||||
scrollEdgeEffects: Platform.OS === "ios" ? HEADER_SCROLL_EDGE_EFFECTS : undefined,
|
||||
headerBackVisible: false,
|
||||
headerBackTitle: "",
|
||||
headerTitle: "Threads",
|
||||
|
||||
Reference in new issue
Block a user