diff options
Diffstat (limited to 'src/view/com/util/TabBar.tsx')
-rw-r--r-- | src/view/com/util/TabBar.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/view/com/util/TabBar.tsx b/src/view/com/util/TabBar.tsx index 67c9276c6..dd8fdcb56 100644 --- a/src/view/com/util/TabBar.tsx +++ b/src/view/com/util/TabBar.tsx @@ -13,6 +13,17 @@ interface Layout { width: number } +export interface TabBarProps { + selectedPage: number + items: string[] + position: Animated.Value + offset: Animated.Value + indicatorPosition?: 'top' | 'bottom' + indicatorColor?: string + onSelect?: (index: number) => void + onPressSelected?: () => void +} + export function TabBar({ selectedPage, items, @@ -22,16 +33,7 @@ export function TabBar({ indicatorColor, onSelect, onPressSelected, -}: { - selectedPage: number - items: string[] - position: Animated.Value - offset: Animated.Value - indicatorPosition?: 'top' | 'bottom' - indicatorColor?: string - onSelect?: (index: number) => void - onPressSelected?: () => void -}) { +}: TabBarProps) { const pal = usePalette('default') const [itemLayouts, setItemLayouts] = useState<Layout[]>( items.map(() => ({x: 0, width: 0})), |