* Working overlay, WIP

* Ok working with no overlay and global gesture handler

* Ok pretty good on native

* Cleanup

* Cleanup

* add animation

* add transform origin to animation

* Some a11y

* Improve colors

* Explicitly wrap gesture handler

* Add easier abstraction

* Web

* Fix animation

* Cleanup and remove provider

* Include demo for now

* Ok diff interface to avoid collapsed views

* Use dimensions hook

* Adjust overlap, clarify intent of consts

* Revert testing edits

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
Eric Bailey
2025-06-24 22:03:23 -05:00
committed by GitHub
parent cd820709b6
commit 4c1515169a
10 changed files with 693 additions and 5 deletions
@@ -0,0 +1,24 @@
import {useEffect} from 'react'
import {
type GlobalGestureEvents,
useGlobalGestureEvents,
} from '#/state/global-gesture-events'
/**
* Listen for global gesture events. Callback should be wrapped with
* `useCallback` or otherwise memoized to avoid unnecessary re-renders.
*/
export function useOnGesture(
onGestureCallback: (e: GlobalGestureEvents['begin']) => void,
) {
const ctx = useGlobalGestureEvents()
useEffect(() => {
ctx.register()
ctx.events.on('begin', onGestureCallback)
return () => {
ctx.unregister()
ctx.events.off('begin', onGestureCallback)
}
}, [ctx, onGestureCallback])
}
@@ -0,0 +1 @@
export function useOnGesture() {}