Bluesky app fork with some witchin' additions 💫

remove root sibling parent(s??) from composer (#8897)

authored by samuel.fm and committed by

GitHub f3905c57 27c591f0

+76 -81
+76 -81
src/view/com/composer/Composer.tsx
··· 40 40 ZoomIn, 41 41 ZoomOut, 42 42 } from 'react-native-reanimated' 43 - import {RootSiblingParent} from 'react-native-root-siblings' 44 43 import {useSafeAreaInsets} from 'react-native-safe-area-context' 45 44 import {type ImagePickerAsset} from 'expo-image-picker' 46 45 import { ··· 663 662 const isWebFooterSticky = !isNative && thread.posts.length > 1 664 663 return ( 665 664 <BottomSheetPortalProvider> 666 - <RootSiblingParent> 667 - <KeyboardAvoidingView 668 - testID="composePostView" 669 - behavior={isIOS ? 'padding' : 'height'} 670 - keyboardVerticalOffset={keyboardVerticalOffset} 671 - style={a.flex_1}> 672 - <View 673 - style={[a.flex_1, viewStyles]} 674 - aria-modal 675 - accessibilityViewIsModal> 676 - <RootSiblingParent> 677 - <ComposerTopBar 678 - canPost={canPost} 679 - isReply={!!replyTo} 680 - isPublishQueued={publishOnUpload} 681 - isPublishing={isPublishing} 682 - isThread={thread.posts.length > 1} 683 - publishingStage={publishingStage} 684 - topBarAnimatedStyle={topBarAnimatedStyle} 685 - onCancel={onPressCancel} 686 - onPublish={onPressPublish}> 687 - {missingAltError && <AltTextReminder error={missingAltError} />} 688 - <ErrorBanner 689 - error={error} 690 - videoState={erroredVideo} 691 - clearError={() => setError('')} 692 - clearVideo={ 693 - erroredVideoPostId 694 - ? () => clearVideo(erroredVideoPostId) 695 - : () => {} 696 - } 697 - /> 698 - </ComposerTopBar> 665 + <KeyboardAvoidingView 666 + testID="composePostView" 667 + behavior={isIOS ? 'padding' : 'height'} 668 + keyboardVerticalOffset={keyboardVerticalOffset} 669 + style={a.flex_1}> 670 + <View 671 + style={[a.flex_1, viewStyles]} 672 + aria-modal 673 + accessibilityViewIsModal> 674 + <ComposerTopBar 675 + canPost={canPost} 676 + isReply={!!replyTo} 677 + isPublishQueued={publishOnUpload} 678 + isPublishing={isPublishing} 679 + isThread={thread.posts.length > 1} 680 + publishingStage={publishingStage} 681 + topBarAnimatedStyle={topBarAnimatedStyle} 682 + onCancel={onPressCancel} 683 + onPublish={onPressPublish}> 684 + {missingAltError && <AltTextReminder error={missingAltError} />} 685 + <ErrorBanner 686 + error={error} 687 + videoState={erroredVideo} 688 + clearError={() => setError('')} 689 + clearVideo={ 690 + erroredVideoPostId 691 + ? () => clearVideo(erroredVideoPostId) 692 + : () => {} 693 + } 694 + /> 695 + </ComposerTopBar> 699 696 700 - <Animated.ScrollView 701 - ref={scrollViewRef} 702 - layout={native(LinearTransition)} 703 - onScroll={scrollHandler} 704 - contentContainerStyle={a.flex_grow} 705 - style={a.flex_1} 706 - keyboardShouldPersistTaps="always" 707 - onContentSizeChange={onScrollViewContentSizeChange} 708 - onLayout={onScrollViewLayout}> 709 - {replyTo ? <ComposerReplyTo replyTo={replyTo} /> : undefined} 710 - {thread.posts.map((post, index) => ( 711 - <React.Fragment key={post.id}> 712 - <ComposerPost 713 - post={post} 714 - dispatch={composerDispatch} 715 - textInput={post.id === activePost.id ? textInput : null} 716 - isFirstPost={index === 0} 717 - isLastPost={index === thread.posts.length - 1} 718 - isPartOfThread={thread.posts.length > 1} 719 - isReply={index > 0 || !!replyTo} 720 - isActive={post.id === activePost.id} 721 - canRemovePost={thread.posts.length > 1} 722 - canRemoveQuote={index > 0 || !initQuote} 723 - onSelectVideo={selectVideo} 724 - onClearVideo={clearVideo} 725 - onPublish={onComposerPostPublish} 726 - onError={setError} 727 - /> 728 - {isWebFooterSticky && post.id === activePost.id && ( 729 - <View style={styles.stickyFooterWeb}>{footer}</View> 730 - )} 731 - </React.Fragment> 732 - ))} 733 - </Animated.ScrollView> 734 - {!isWebFooterSticky && footer} 735 - </RootSiblingParent> 736 - </View> 697 + <Animated.ScrollView 698 + ref={scrollViewRef} 699 + layout={native(LinearTransition)} 700 + onScroll={scrollHandler} 701 + contentContainerStyle={a.flex_grow} 702 + style={a.flex_1} 703 + keyboardShouldPersistTaps="always" 704 + onContentSizeChange={onScrollViewContentSizeChange} 705 + onLayout={onScrollViewLayout}> 706 + {replyTo ? <ComposerReplyTo replyTo={replyTo} /> : undefined} 707 + {thread.posts.map((post, index) => ( 708 + <React.Fragment key={post.id}> 709 + <ComposerPost 710 + post={post} 711 + dispatch={composerDispatch} 712 + textInput={post.id === activePost.id ? textInput : null} 713 + isFirstPost={index === 0} 714 + isLastPost={index === thread.posts.length - 1} 715 + isPartOfThread={thread.posts.length > 1} 716 + isReply={index > 0 || !!replyTo} 717 + isActive={post.id === activePost.id} 718 + canRemovePost={thread.posts.length > 1} 719 + canRemoveQuote={index > 0 || !initQuote} 720 + onSelectVideo={selectVideo} 721 + onClearVideo={clearVideo} 722 + onPublish={onComposerPostPublish} 723 + onError={setError} 724 + /> 725 + {isWebFooterSticky && post.id === activePost.id && ( 726 + <View style={styles.stickyFooterWeb}>{footer}</View> 727 + )} 728 + </React.Fragment> 729 + ))} 730 + </Animated.ScrollView> 731 + {!isWebFooterSticky && footer} 732 + </View> 737 733 738 - <Prompt.Basic 739 - control={discardPromptControl} 740 - title={_(msg`Discard draft?`)} 741 - description={_(msg`Are you sure you'd like to discard this draft?`)} 742 - onConfirm={onClose} 743 - confirmButtonCta={_(msg`Discard`)} 744 - confirmButtonColor="negative" 745 - /> 746 - </KeyboardAvoidingView> 747 - </RootSiblingParent> 734 + <Prompt.Basic 735 + control={discardPromptControl} 736 + title={_(msg`Discard draft?`)} 737 + description={_(msg`Are you sure you'd like to discard this draft?`)} 738 + onConfirm={onClose} 739 + confirmButtonCta={_(msg`Discard`)} 740 + confirmButtonColor="negative" 741 + /> 742 + </KeyboardAvoidingView> 748 743 </BottomSheetPortalProvider> 749 744 ) 750 745 }