1- import { cn } from "@follow/utils"
21import * as Haptics from "expo-haptics"
32import { useCallback , useRef , useState } from "react"
4- import { useTranslation } from "react-i18next"
53import type { NativeScrollEvent , NativeSyntheticEvent } from "react-native"
6- import { View } from "react-native"
74import { useSharedValue } from "react-native-reanimated"
85import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes"
9- import { useSafeAreaInsets } from "react-native-safe-area-context"
10- import { useColor } from "react-native-uikit-colors"
11-
12- import { Text } from "@/src/components/ui/typography/Text"
13- import { ArrowLeftCuteReIcon } from "@/src/icons/arrow_left_cute_re"
146
7+ import { PullUpIndicatorIos } from "./PullUpIndicatorIos"
158import type { UsePullUpToNextProps , UsePullUpToNextReturn } from "./types"
169
1710// eslint-disable-next-line react-refresh/only-export-components
@@ -21,52 +14,6 @@ const EmptyGestureWrapper: UsePullUpToNextReturn["GestureWrapper"] = ({
2114 children ?: React . ReactNode
2215} ) => children
2316
24- /**
25- * Component that handles pulling up to navigate to the next unread entry
26- */
27- const EntryPullUpToNext : UsePullUpToNextReturn [ "EntryPullUpToNext" ] = ( {
28- active,
29- hide = false ,
30- } ) => {
31- const { t } = useTranslation ( )
32- const insets = useSafeAreaInsets ( )
33- const textColor = useColor ( "secondaryLabel" )
34- const iconColor = useColor ( "label" )
35- return (
36- < View
37- className = { cn (
38- "absolute bottom-0 flex w-full translate-y-full flex-row items-center justify-center gap-2 pt-4 transition-all duration-200" ,
39- hide ? "opacity-0" : "opacity-100" ,
40- ) }
41- style = { {
42- paddingBottom : insets . bottom + 20 ,
43- } }
44- >
45- < View
46- className = { cn (
47- "flex flex-row items-center gap-2 transition-all duration-200" ,
48- active ? "opacity-50" : "opacity-80" ,
49- ) }
50- >
51- < View
52- className = { cn (
53- "rotate-90 transition-all duration-200" ,
54- active ? "opacity-0" : "opacity-100" ,
55- ) }
56- >
57- < ArrowLeftCuteReIcon width = { 16 } height = { 16 } color = { iconColor } />
58- </ View >
59- < Text
60- style = { {
61- color : textColor ,
62- } }
63- >
64- { active ? t ( "entry.release_to_next_entry" ) : t ( "entry.pull_up_to_next_entry" ) }
65- </ Text >
66- </ View >
67- </ View >
68- )
69- }
7017export const usePullUpToNext = ( {
7118 enabled = true ,
7219 onRefresh,
@@ -155,7 +102,7 @@ export const usePullUpToNext = ({
155102 hide : ! dragState ,
156103 translateY,
157104 } satisfies UsePullUpToNextReturn [ "pullUpViewProps" ] ,
158- EntryPullUpToNext,
105+ EntryPullUpToNext : PullUpIndicatorIos ,
159106 GestureWrapper : EmptyGestureWrapper ,
160107 gestureWrapperProps : {
161108 enabled : false ,
0 commit comments