about summary refs log tree commit diff
path: root/src/view/com/pager/DraggableScrollView.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-05-25 21:17:11 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-05-25 21:17:11 -0500
commit7b6948e6171b448e271f0564efd1f186ccadb9b8 (patch)
treee0d1b6e9f9c863cbff53f8832fd55d03cb670a83 /src/view/com/pager/DraggableScrollView.tsx
parent15c1b6ee157471807a723161066ba4ce5e12c0b5 (diff)
parente832352e9844002408b45291396a3c495be23276 (diff)
downloadvoidsky-7b6948e6171b448e271f0564efd1f186ccadb9b8.tar.zst
Merge branch 'custom-algos' into main
Diffstat (limited to 'src/view/com/pager/DraggableScrollView.tsx')
-rw-r--r--src/view/com/pager/DraggableScrollView.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/view/com/pager/DraggableScrollView.tsx b/src/view/com/pager/DraggableScrollView.tsx
new file mode 100644
index 000000000..4b7396eaa
--- /dev/null
+++ b/src/view/com/pager/DraggableScrollView.tsx
@@ -0,0 +1,15 @@
+import {useDraggableScroll} from 'lib/hooks/useDraggableScrollView'
+import React, {ComponentProps} from 'react'
+import {ScrollView} from 'react-native'
+
+export const DraggableScrollView = React.forwardRef<
+  ScrollView,
+  ComponentProps<typeof ScrollView>
+>(function DraggableScrollView(props, ref) {
+  const {refs} = useDraggableScroll<ScrollView>({
+    outerRef: ref,
+    cursor: 'grab', // optional, default
+  })
+
+  return <ScrollView ref={refs} horizontal {...props} />
+})