diff --git a/src/view/com/home/HomeHeader.tsx b/src/view/com/home/HomeHeader.tsx index a9647f8419..e40cd232c2 100644 --- a/src/view/com/home/HomeHeader.tsx +++ b/src/view/com/home/HomeHeader.tsx @@ -1,7 +1,6 @@ import React from 'react' import {useNavigation} from '@react-navigation/native' -import {usePalette} from '#/lib/hooks/usePalette' import {NavigationProp} from '#/lib/routes/types' import {FeedSourceInfo} from '#/state/queries/feed' import {useSession} from '#/state/session' @@ -19,7 +18,6 @@ export function HomeHeader( const {feeds} = props const {hasSession} = useSession() const navigation = useNavigation() - const pal = usePalette('default') const hasPinnedCustom = React.useMemo(() => { if (!hasSession) return false @@ -61,7 +59,6 @@ export function HomeHeader( onSelect={onSelect} testID={props.testID} items={items} - indicatorColor={pal.colors.link} dragGesture={props.dragGesture} /> diff --git a/src/view/com/pager/TabBar.tsx b/src/view/com/pager/TabBar.tsx index 1c5b4e2fa8..f633c658f8 100644 --- a/src/view/com/pager/TabBar.tsx +++ b/src/view/com/pager/TabBar.tsx @@ -16,7 +16,6 @@ export interface TabBarProps { testID?: string selectedPage: number items: string[] - indicatorColor?: string onSelect?: (index: number) => void onPressSelected?: (index: number) => void } @@ -25,17 +24,12 @@ export function TabBar({ testID, selectedPage, items, - indicatorColor, onSelect, onPressSelected, dragGesture, }: TabBarProps) { const pal = usePalette('default') const scrollElRef = useAnimatedRef() - const indicatorStyle = useMemo( - () => ({borderBottomColor: indicatorColor || pal.colors.link}), - [indicatorColor, pal], - ) const onPressItem = useCallback( (index: number) => { @@ -96,28 +90,15 @@ export function TabBar({ }, ]}> {items.map((item, i) => { - const selected = i === selectedPage return ( - onPressItem(i)} - accessibilityRole="tab"> - - - {item} - - - + ) })} @@ -127,6 +108,44 @@ export function TabBar({ ) } +function TabBarItem({ + index, + testID, + selected, + item, + onPressItem, +}: { + index: number + testID: string | undefined + selected: boolean + item: string + onPressItem: (index: number) => void +}) { + const pal = usePalette('default') + const indicatorStyle = useMemo( + () => ({borderBottomColor: pal.colors.link}), + [pal], + ) + return ( + onPressItem(index)} + accessibilityRole="tab"> + + + {item} + + + + ) +} + const styles = StyleSheet.create({ outer: { flexDirection: 'row',