diff --git a/src/view/com/pager/TabBar.tsx b/src/view/com/pager/TabBar.tsx index a8a02e57fe..73a2a4c1c0 100644 --- a/src/view/com/pager/TabBar.tsx +++ b/src/view/com/pager/TabBar.tsx @@ -4,6 +4,7 @@ import Animated, { interpolate, runOnUI, scrollTo, + SharedValue, useAnimatedReaction, useAnimatedRef, useAnimatedStyle, @@ -189,7 +190,7 @@ export function TabBar({ @@ -221,17 +222,25 @@ export function TabBar({ function TabBarItem({ index, testID, - selected, + dragProgress, item, onPressItem, }: { index: number testID: string | undefined - selected: boolean + dragProgress: SharedValue item: string onPressItem: (index: number) => void }) { const pal = usePalette('default') + const style = useAnimatedStyle(() => ({ + opacity: interpolate( + dragProgress.get(), + [index - 1, index, index + 1], + [0.7, 1, 0.7], + 'clamp', + ), + })) return ( onPressItem(index)} accessibilityRole="tab"> - + + style={[pal.text, {lineHeight: 20}]}> {item} - + ) }