Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/pages/inbox/sidebar/FABPopoverContent/FABPopoverMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useState} from 'react';
import type {RefObject} from 'react';
import React, {Activity, useState} from 'react';
import type {ActivityProps, RefObject} from 'react';
import {View} from 'react-native';
import FocusTrapForModal from '@components/FocusTrap/FocusTrapForModal';
import PopoverWithMeasuredContent from '@components/PopoverWithMeasuredContent';
Expand Down Expand Up @@ -40,6 +40,7 @@ function FABPopoverMenu({isVisible, onClose, onItemSelected, anchorRef, animatio
const {shouldUseNarrowLayout} = useResponsiveLayout();
const {windowHeight} = useWindowDimensions();
const anchorPosition = styles.createMenuPositionSidebar(windowHeight);
const [contentActivityMode, setContentActivityMode] = useState<ActivityProps['mode']>(isVisible ? 'visible' : 'hidden');

const [registeredSet, setRegisteredSet] = useState<ReadonlySet<string>>(new Set());

Expand Down Expand Up @@ -112,6 +113,8 @@ function FABPopoverMenu({isVisible, onClose, onItemSelected, anchorRef, animatio
}}
onClose={handleClose}
isVisible={isVisible}
onModalWillShow={() => setContentActivityMode('visible')}
onModalHide={() => setContentActivityMode('hidden')}
Comment thread
rlinoz marked this conversation as resolved.
Resolved
fromSidebarMediumScreen={!shouldUseNarrowLayout}
animationIn="fadeIn"
animationOut="fadeOut"
Expand All @@ -125,9 +128,11 @@ function FABPopoverMenu({isVisible, onClose, onItemSelected, anchorRef, animatio
active={isVisible}
shouldReturnFocus
>
<View style={shouldUseNarrowLayout ? styles.flexGrow1 : [styles.createMenuContainer, styles.pv0, styles.flex1]}>
<View style={styles.pv4}>{children}</View>
</View>
<Activity mode={contentActivityMode}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not using isVisible ? 'visible' : 'hidden' directly here because of modal animation, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not using isVisible ? 'visible' : 'hidden' directly here because of modal animation, right?

correct.

<View style={shouldUseNarrowLayout ? styles.flexGrow1 : [styles.createMenuContainer, styles.pv0, styles.flex1]}>
<View style={styles.pv4}>{children}</View>
</View>
</Activity>
</FocusTrapForModal>
</PopoverWithMeasuredContent>
</FABMenuContext.Provider>
Expand Down
Loading