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
7 changes: 3 additions & 4 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ class MoneyRequestConfirmationList extends Component {
boldStyle
shouldTextInputAppearBelowOptions
shouldShowTextInput={false}
shouldUseStyleForChildren={false}
optionHoveredStyle={canModifyParticipants ? styles.hoveredComponentBG : {}}
footerContent={shouldShowSettlementButton
? (
Expand All @@ -313,19 +314,17 @@ class MoneyRequestConfirmationList extends Component {
shouldShowRightIcon
title={formattedAmount}
description={this.props.translate('iou.amount')}
interactive={false} // This is so the menu item's background doesn't change color on hover
onPress={() => this.props.navigateToStep(0)}
style={styles.moneyRequestMenuItem}
style={[styles.moneyRequestMenuItem, styles.mt2]}
titleStyle={styles.moneyRequestConfirmationAmount}
disabled={this.state.didConfirm}
/>
<MenuItemWithTopDescription
shouldShowRightIcon
title={this.props.iou.comment}
description={this.props.translate('common.description')}
interactive={false} // This is so the menu item's background doesn't change color on hover
onPress={() => Navigation.navigate(ROUTES.MONEY_REQUEST_DESCRIPTION)}
style={styles.moneyRequestMenuItem}
style={[styles.moneyRequestMenuItem, styles.mb2]}
disabled={this.state.didConfirm}
/>
</OptionsSelector>
Expand Down
4 changes: 2 additions & 2 deletions src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ class BaseOptionsSelector extends Component {
<View style={[styles.flexGrow0, styles.flexShrink1, styles.flexBasisAuto, styles.w100, styles.flexRow]}>
{optionsList}
</View>
<View style={[styles.ph5, styles.pv5, styles.flexGrow1, styles.flexShrink0]}>
<View style={this.props.shouldUseStyleForChildren ? [styles.ph5, styles.pv5, styles.flexGrow1, styles.flexShrink0] : []}>

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.

Let's make sure that styles.flexGrow1, styles.flexShrink0 removal doesn't cause any regressions, though I tested and confirmed.

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.

@aimane-chnaif Yes, I tested again and can confirm, doesn't look prone to any regressions.

I tried resizing the window on desktop and web and the existence / lack thereof flex styles does not affect the position or behaviour.

{this.props.children}
{this.props.shouldShowTextInput && textInput}
</View>
</>
) : (
<>
<View style={[styles.ph5, styles.pb3]}>
<View style={this.props.shouldUseStyleForChildren ? [styles.ph5, styles.pb3] : []}>
{this.props.children}
{this.props.shouldShowTextInput && textInput}
</View>
Expand Down
4 changes: 4 additions & 0 deletions src/components/OptionsSelector/optionsSelectorPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ const propTypes = {

/** Key of the option that we should focus on when first opening the options list */
initiallyFocusedOptionKey: PropTypes.string,

/** Whether to use default padding and flex styles for children */
shouldUseStyleForChildren: PropTypes.bool,
};

const defaultProps = {
Expand Down Expand Up @@ -130,6 +133,7 @@ const defaultProps = {
maxLength: undefined,
shouldShowTextInput: true,
onChangeText: () => {},
shouldUseStyleForChildren: true,
};

export {propTypes, defaultProps};
3 changes: 2 additions & 1 deletion src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,8 @@ const styles = {
borderRadius: 0,
justifyContent: 'space-between',
width: '100%',
marginBottom: 20,
paddingHorizontal: 20,
paddingVertical: 12,
},

iouPreviewBox: {
Expand Down