Skip to content

Commit

Permalink
Merge pull request #19682 from cubuspl42/fix-appbanner-height-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Mechler authored May 30, 2023
2 parents b82205d + b3454c0 commit 70e5aeb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class AuthScreens extends React.Component {
}

shouldComponentUpdate(nextProps) {
return nextProps.isSmallScreenWidth !== this.props.isSmallScreenWidth;
return nextProps.windowHeight !== this.props.windowHeight || nextProps.isSmallScreenWidth !== this.props.isSmallScreenWidth;
}

componentWillUnmount() {
Expand All @@ -184,7 +184,10 @@ class AuthScreens extends React.Component {
};
const modalScreenOptions = {
...commonModalScreenOptions,
cardStyle: getNavigationModalCardStyle(this.props.isSmallScreenWidth),
cardStyle: getNavigationModalCardStyle({
windowHeight: this.props.windowHeight,
isSmallScreenWidth: this.props.isSmallScreenWidth,
}),
cardStyleInterpolator: (props) => modalCardStyleInterpolator(this.props.isSmallScreenWidth, false, props),
cardOverlayEnabled: true,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import variables from '../variables';

export default (isSmallScreenWidth) => ({
export default ({isSmallScreenWidth}) => ({
position: 'absolute',
top: 0,
right: 0,
Expand Down
12 changes: 7 additions & 5 deletions src/styles/getNavigationModalCardStyles/index.website.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import getBaseNavigationModalCardStyles from './getBaseNavigationModalCardStyles';

export default (isSmallScreenWidth) => ({
...getBaseNavigationModalCardStyles(isSmallScreenWidth),
export default ({windowHeight, 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%)',
// This height is passed from JavaScript, instead of using CSS expressions like "100%" or "100vh", to work around
// Safari issues:
// https://github.com/Expensify/App/issues/12005
// https://github.com/Expensify/App/issues/17824
height: `${windowHeight}px`,
});

0 comments on commit 70e5aeb

Please sign in to comment.