diff --git a/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx b/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx index 5d3cdf5ad..8ce665809 100644 --- a/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx +++ b/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx @@ -1,9 +1,11 @@ import { cn } from "@follow/utils" +import { useEffect } from "react" import { Text, View } from "react-native" -import ReAnimated, { useAnimatedStyle, useSharedValue } from "react-native-reanimated" +import ReAnimated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated" import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime" import { FeedIcon } from "@/src/components/ui/icon/feed-icon" +import { gentleSpringPreset } from "@/src/constants/spring" import { useEntry } from "@/src/store/entry/hooks" import { useFeed } from "@/src/store/feed/hooks" @@ -19,6 +21,16 @@ export const EntryGridFooter = ({ const unreadZoomSharedValue = useSharedValue(entry?.read ? 0 : 1) + useEffect(() => { + if (!entry) return + + if (entry.read) { + unreadZoomSharedValue.value = withSpring(0, gentleSpringPreset) + } else { + unreadZoomSharedValue.value = withSpring(1, gentleSpringPreset) + } + }, [entry, entry?.read, unreadZoomSharedValue]) + const unreadIndicatorStyle = useAnimatedStyle(() => { return { width: unreadZoomSharedValue.value * 8,