forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {type ComponentPropsWithRef} from 'react'
2import {ScrollView} from 'react-native'
3
4import {useDraggableScroll} from '#/lib/hooks/useDraggableScrollView'
5import {atoms as a, web} from '#/alf'
6
7export function DraggableScrollView({
8 ref,
9 style,
10 ...props
11}: ComponentPropsWithRef<typeof ScrollView>) {
12 const {refs} = useDraggableScroll<ScrollView>({
13 outerRef: ref,
14 cursor: 'grab', // optional, default
15 })
16
17 return (
18 <ScrollView
19 ref={refs}
20 style={[style, web(a.user_select_none)]}
21 horizontal
22 {...props}
23 />
24 )
25}