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

Fix/15373 last message in the report shows for a brief moment #16332

Merged
merged 4 commits into from
Mar 22, 2023
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
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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

As suggested by @situchan, add doc of description, params and return value.

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.