Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports big screens mobile devices for popover menu #6278

Merged
Merged
Show file tree
Hide file tree
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
25 changes: 11 additions & 14 deletions src/components/Popover/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@ const propTypes = {
* This is a convenience wrapper around the Modal component for a responsive Popover.
* On small screen widths, it uses BottomDocked modal type, and a Popover type on wide screen widths.
*/
const Popover = (props) => {
const propsWithoutAnimation = _.omit(props, ['animationIn', 'animationOut', 'popoverAnchorPosition', 'disableAnimation']);
return (
<Modal
type={CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED}
// eslint-disable-next-line react/jsx-props-no-spreading
{...propsWithoutAnimation}

// Mobile will always has fullscreen menu
// eslint-disable-next-line react/jsx-props-no-multi-spaces
fullscreen
/>
);
};
const Popover = props => (
<Modal
type={props.isSmallScreenWidth ? CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED : CONST.MODAL.MODAL_TYPE.POPOVER}
popoverAnchorPosition={props.isSmallScreenWidth ? undefined : props.anchorPosition}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
fullscreen={props.isSmallScreenWidth ? true : props.fullscreen}
animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}
/>
);

Popover.propTypes = propTypes;
Popover.defaultProps = defaultProps;
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverMenu/BasePopoverMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class BasePopoverMenu extends PureComponent {
onModalHide={this.props.onMenuHide}
animationIn={this.props.animationIn}
animationOut={this.props.animationOut}
isSmallScreenWidth={this.props.isSmallScreenWidth}
disableAnimation={this.props.disableAnimation}
>
<View style={this.props.isSmallScreenWidth ? {} : styles.createMenuContainer}>
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class SidebarScreen extends Component {
isVisible={this.state.isCreateMenuActive}
anchorPosition={styles.createMenuPositionSidebar}
onItemSelected={this.onCreateMenuItemSelected}
isSmallScreenWidth={this.props.isSmallScreenWidth}
menuItems={[
{
icon: ChatBubble,
Expand Down