Skip to content

Commit

Permalink
Merge pull request #16332 from tienifr/fix/15373
Browse files Browse the repository at this point in the history
Fix/15373 last message in the report shows for a brief moment
  • Loading branch information
aldo-expensify authored Mar 22, 2023
2 parents e9cfaaa + 0befe08 commit 95d7990
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ class AttachmentModal extends PureComponent {
return (
<>
<Modal
statusBarTranslucent={false}
type={this.state.modalType}
onSubmit={this.submitAndClose}
onClose={() => this.setState({isModalOpen: false})}
Expand Down
1 change: 0 additions & 1 deletion src/components/AvatarCropModal/AvatarCropModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ const AvatarCropModal = (props) => {
isVisible={props.isVisible}
type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED}
onModalHide={resetState}
statusBarTranslucent={false}
>
{props.isSmallScreenWidth && <HeaderGap />}
<HeaderWithCloseButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/BaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class BaseModal extends PureComponent {
paddingBottom: safeAreaPaddingBottom,
paddingLeft: safeAreaPaddingLeft,
paddingRight: safeAreaPaddingRight,
} = StyleUtils.getSafeAreaPadding(insets);
} = StyleUtils.getSafeAreaPadding(insets, this.props.statusBarTranslucent);

const modalPaddingStyles = StyleUtils.getModalPaddingStyles({
safeAreaPaddingTop,
Expand Down
12 changes: 12 additions & 0 deletions src/libs/getSafeAreaPaddingTop/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {StatusBar} from 'react-native';

/**
* Returns safe area padding top to use for a View
*
* @param {Object} insets
* @param {Boolean} statusBarTranslucent
* @returns {Number}
*/
export default function getSafeAreaPaddingTop(insets, statusBarTranslucent) {
return (statusBarTranslucent && StatusBar.currentHeight) || 0;
}
9 changes: 9 additions & 0 deletions src/libs/getSafeAreaPaddingTop/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Takes safe area insets and returns padding top to use for a View
*
* @param {Object} insets
* @returns {Number}
*/
export default function getSafeAreaPaddingTop(insets) {
return insets.top;
}
6 changes: 4 additions & 2 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import colors from './colors';
import positioning from './utilities/positioning';
import styles from './styles';
import * as ReportUtils from '../libs/ReportUtils';
import getSafeAreaPaddingTop from '../libs/getSafeAreaPaddingTop';

const workspaceColorOptions = [
{backgroundColor: colors.blue200, fill: colors.blue700},
Expand Down Expand Up @@ -125,11 +126,12 @@ function getDefaultWorspaceAvatarColor(workspaceName) {
* Takes safe area insets and returns padding to use for a View
*
* @param {Object} insets
* @param {Boolean} statusBarTranslucent
* @returns {Object}
*/
function getSafeAreaPadding(insets) {
function getSafeAreaPadding(insets, statusBarTranslucent) {
return {
paddingTop: insets.top,
paddingTop: getSafeAreaPaddingTop(insets, statusBarTranslucent),
paddingBottom: insets.bottom * variables.safeInsertPercentage,
paddingLeft: insets.left * variables.safeInsertPercentage,
paddingRight: insets.right * variables.safeInsertPercentage,
Expand Down
8 changes: 0 additions & 8 deletions src/styles/getModalStyles/index.android.js

This file was deleted.

0 comments on commit 95d7990

Please sign in to comment.