diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-10-08 20:00:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-08 20:00:49 +0300 |
commit | fc82d2f6d5e8a93f0e7ce4861c5205c8a4b49c30 (patch) | |
tree | 51e618db283d28ef241f0e6f2f6180004e6cb6e7 /src/view/com/composer/Composer.tsx | |
parent | efcf8a6ae59d9767bc2289af927a2e12bc39a054 (diff) | |
download | voidsky-fc82d2f6d5e8a93f0e7ce4861c5205c8a4b49c30.tar.zst |
Move Dialogs to Radix (#5648)
* Use Redix FocusTrap (#5638) * Use Redix FocusTrap * force resolutions on radix libs * add focus guards * use @radix-ui/dismissable-layer for escape handling * fix banner menu keypress by using `Pressable` * add menu in dialog example to storybook --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com> * use DismissableLayer/FocusScope for composer * fix storybook dialog * thread Portal through Prompt and avatar/banner * fix dialog style regression * remove tamagui --------- Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 55c2d81ab..8cc8fba0d 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -65,7 +65,6 @@ import {useDialogStateControlContext} from '#/state/dialogs' import {emitPostCreated} from '#/state/events' import {ComposerImage, pasteImage} from '#/state/gallery' import {useModalControls} from '#/state/modals' -import {useModals} from '#/state/modals' import {useRequireAltTextEnabled} from '#/state/preferences' import { toPostLanguages, @@ -146,7 +145,6 @@ export const ComposePost = ({ const queryClient = useQueryClient() const currentDid = currentAccount!.did const {data: currentProfile} = useProfileQuery({did: currentDid}) - const {isModalActive} = useModals() const {closeComposer} = useComposerControls() const pal = usePalette('default') const {isMobile} = useWebMediaQueries() @@ -303,22 +301,6 @@ export const ComposePost = ({ } }, [onPressCancel, closeAllDialogs, closeAllModals]) - // listen to escape key on desktop web - const onEscape = useCallback( - (e: KeyboardEvent) => { - if (e.key === 'Escape') { - onPressCancel() - } - }, - [onPressCancel], - ) - useEffect(() => { - if (isWeb && !isModalActive) { - window.addEventListener('keydown', onEscape) - return () => window.removeEventListener('keydown', onEscape) - } - }, [onEscape, isModalActive]) - const onNewLink = useCallback((uri: string) => { dispatch({type: 'embed_add_uri', uri}) }, []) |