make tab bar scroll view draggable on web

This commit is contained in:
Ansh Nanda 2023-05-24 15:04:30 -07:00
parent 7e555ecc1b
commit 32c9dabb74
5 changed files with 130 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import {Text} from '../util/text/Text'
import {PressableWithHover} from '../util/PressableWithHover'
import {usePalette} from 'lib/hooks/usePalette'
import {isDesktopWeb} from 'platform/detection'
import {DraggableScrollView} from './DraggableScrollView'
export interface TabBarProps {
testID?: string
@ -75,7 +76,7 @@ export function TabBar({
return (
<View testID={testID} style={[pal.view, styles.outer]}>
<ScrollView
<DraggableScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
ref={scrollElRef}
@ -98,7 +99,7 @@ export function TabBar({
</PressableWithHover>
)
})}
</ScrollView>
</DraggableScrollView>
</View>
)
}