diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-10-09 21:30:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-09 11:30:42 -0700 |
commit | cca344a3d1cdca3d4e63806a9bd5f7867f8961d4 (patch) | |
tree | 999d7dffe5d53989b7e217db13f451c6d019ff57 /src/view/com/composer/Composer.tsx | |
parent | b3ade19bbe3da3caf07bf9561cebb11dac4b6afc (diff) | |
download | voidsky-cca344a3d1cdca3d4e63806a9bd5f7867f8961d4.tar.zst |
Allow nested sheets without boilerplate (#5660)
Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 8cc8fba0d..49a498cce 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -107,9 +107,9 @@ import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons/Emoji' import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' -import {createPortalGroup} from '#/components/Portal' import * as Prompt from '#/components/Prompt' import {Text as NewText} from '#/components/Typography' +import {BottomSheetPortalProvider} from '../../../../modules/bottom-sheet' import { composerReducer, createComposerState, @@ -117,8 +117,6 @@ import { } from './state/composer' import {NO_VIDEO, NoVideoState, processVideo, VideoState} from './state/video' -const Portal = createPortalGroup() - type CancelRef = { onPressCancel: () => void } @@ -522,7 +520,7 @@ export const ComposePost = ({ const keyboardVerticalOffset = useKeyboardVerticalOffset() return ( - <Portal.Provider> + <BottomSheetPortalProvider> <KeyboardAvoidingView testID="composePostView" behavior={isIOS ? 'padding' : 'height'} @@ -666,11 +664,7 @@ export const ComposePost = ({ /> </View> - <Gallery - images={images} - dispatch={dispatch} - Portal={Portal.Portal} - /> + <Gallery images={images} dispatch={dispatch} /> {extGif && ( <View style={a.relative} key={extGif.url}> @@ -684,7 +678,6 @@ export const ComposePost = ({ gif={extGif} altText={extGifAlt ?? ''} onSubmit={handleChangeGifAltText} - Portal={Portal.Portal} /> </View> )} @@ -744,7 +737,6 @@ export const ComposePost = ({ }, }) }} - Portal={Portal.Portal} /> </Animated.View> )} @@ -782,7 +774,6 @@ export const ComposePost = ({ }) }} style={bottomBarAnimatedStyle} - Portal={Portal.Portal} /> )} <View @@ -819,7 +810,6 @@ export const ComposePost = ({ onClose={focusTextInput} onSelectGif={onSelectGif} disabled={hasMedia} - Portal={Portal.Portal} /> {!isMobile ? ( <Button @@ -849,11 +839,9 @@ export const ComposePost = ({ onConfirm={onClose} confirmButtonCta={_(msg`Discard`)} confirmButtonColor="negative" - Portal={Portal.Portal} /> </KeyboardAvoidingView> - <Portal.Outlet /> - </Portal.Provider> + </BottomSheetPortalProvider> ) } |