feat(timeline): enhance unread message indicator with animated visibility

- Wrapped the UnreadCount component in an Animated.View to improve visibility during drag interactions.
- Added opacity animation based on drag progress to create a smoother user experience.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-06-30 20:15:08 +08:00
parent b4eb9200d8
commit 86d75b9252
@@ -199,12 +199,25 @@ function ViewItem({
>
{t(view.name)}
</Text>
<UnreadCount
max={99}
unread={unreadCount}
dotClassName="size-1.5 rounded-full bg-white"
textClassName="text-white font-bold flex-1"
/>
<Animated.View
style={useAnimatedStyle(() => ({
opacity: interpolate(
dragProgress.get(),
[index - 1, index, index + 1],
[0, 1, 0],
"clamp",
),
}))}
>
{unreadCount > 0 && (
<UnreadCount
max={99}
unread={unreadCount}
dotClassName="size-1.5 rounded-full bg-white"
textClassName="text-white font-bold flex-1"
/>
)}
</Animated.View>
</Animated.View>
{/* Unread indicator for inactive items */}