Skip to content
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
4 changes: 2 additions & 2 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Onyx, {withOnyx} from 'react-native-onyx';
import moment from 'moment';
import _ from 'underscore';
import lodashGet from 'lodash/get';
import * as StyleUtils from '../../../styles/StyleUtils';
import getNavigationModalCardStyle from '../../../styles/getNavigationModalCardStyles';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import CONST from '../../../CONST';
import compose from '../../compose';
Expand Down Expand Up @@ -149,7 +149,7 @@ class AuthScreens extends React.Component {
};
const modalScreenOptions = {
...commonModalScreenOptions,
cardStyle: StyleUtils.getNavigationModalCardStyle(this.props.isSmallScreenWidth),
cardStyle: getNavigationModalCardStyle(this.props.isSmallScreenWidth),
cardStyleInterpolator: props => modalCardStyleInterpolator(this.props.isSmallScreenWidth, false, props),
cardOverlayEnabled: true,

Expand Down
12 changes: 0 additions & 12 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,6 @@ function getNavigationDrawerType(isSmallScreenWidth) {
return isSmallScreenWidth ? 'slide' : 'permanent';
}

function getNavigationModalCardStyle(isSmallScreenWidth) {
return {
position: 'absolute',
top: 0,
right: 0,
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
backgroundColor: 'transparent',
height: '100%',
};
}

/**
* @param {Boolean} isZoomed
* @param {Boolean} isDragging
Expand Down Expand Up @@ -547,7 +536,6 @@ export {
getSafeAreaMargins,
getNavigationDrawerStyle,
getNavigationDrawerType,
getNavigationModalCardStyle,
getZoomCursorStyle,
getZoomSizingStyle,
getAutoGrowTextInputStyle,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import variables from '../variables';

export default isSmallScreenWidth => ({
position: 'absolute',
top: 0,
right: 0,
width: isSmallScreenWidth ? '100%' : variables.sideBarWidth,
backgroundColor: 'transparent',
height: '100%',
});
3 changes: 3 additions & 0 deletions src/styles/getNavigationModalCardStyles/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import getBaseNavigationModalCardStyles from './getBaseNavigationModalCardStyles';

export default getBaseNavigationModalCardStyles;
9 changes: 9 additions & 0 deletions src/styles/getNavigationModalCardStyles/index.website.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import getBaseNavigationModalCardStyles from './getBaseNavigationModalCardStyles';

export default isSmallScreenWidth => ({
...getBaseNavigationModalCardStyles(isSmallScreenWidth),

// This makes the modal card take up the full height of the screen on Desktop Safari and iOS Safari
// https://github.com/Expensify/App/pull/12509/files#r1018107162
height: 'calc(100vh - 100%)',

@rushatgabhane rushatgabhane Nov 8, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@VikalpP i'm sorry but I don't understand why we're doing calc(100vh - 100%) and not just 100vh

which particular platform needs it and when?

@VikalpP VikalpP Nov 9, 2022

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.

Simply setting it as 100vh would not work on mobile iOS Safari.

height: 100vh height: calc(100vh - 100%)
1 2

** This one is a hack that used for the past 4 years to make things work on both platforms around Safari.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you please add a comment explaining this in code as well? thanks!

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.

Done ✅

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.

👋This has caused a regression in #17824, where the applinks banner would make the height calculation incorrect (mobile Safari only)
image
image

We resolved both bugs by passing the screen height from JS side using withWindowDimensions, i.e
height: props.windowHeight

});