Skip to content

Commit

Permalink
Merge pull request #9610 from Expensify/chirag-double-maxParticipant-…
Browse files Browse the repository at this point in the history
…message-fix
  • Loading branch information
roryabraham authored Jun 28, 2022
2 parents 715f715 + 99db026 commit dff9e9c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
19 changes: 1 addition & 18 deletions src/components/OptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ const propTypes = {
/** Text to show in the confirm button (only visible if multiple options are selected) */
confirmButtonText: PropTypes.string,

/** True if the maximum number of options have been selected, false otherwise. */
maxParticipantsReached: PropTypes.bool,

/** Text to show if the maximum number of participants are reached */
maxParticipantsReachedMessage: PropTypes.string,

/** Function to execute if the confirm button is pressed */
onConfirmSelection: PropTypes.func,

Expand Down Expand Up @@ -138,8 +132,6 @@ const defaultProps = {
autoFocus: true,
shouldShowConfirmButton: false,
confirmButtonText: undefined,
maxParticipantsReached: false,
maxParticipantsReachedMessage: undefined,
onConfirmSelection: () => {},
shouldTextInputAppearBelowOptions: false,
shouldShowOfflineMessage: false,
Expand Down Expand Up @@ -332,10 +324,6 @@ class OptionsSelector extends Component {
? this.props.translate('common.confirm')
: this.props.confirmButtonText;
const shouldShowDefaultConfirmButton = !this.props.footerContent && defaultConfirmButtonText;
const defaultMaxParticipantsReachedMessage = _.isUndefined(this.props.maxParticipantsReachedMessage)
? this.props.translate('common.maxParticipantsReached', {count: this.props.selectedOptions.length})
: this.props.maxParticipantsReachedMessage;
const shouldShowMaxParticipantsMessage = this.props.maxParticipantsReached && defaultMaxParticipantsReachedMessage;
const textInput = (
<TextInput
ref={el => this.textInput = el}
Expand Down Expand Up @@ -404,12 +392,7 @@ class OptionsSelector extends Component {
</View>
{shouldShowFooter && (
<FixedFooter>
{shouldShowMaxParticipantsMessage && (
<Text style={[styles.textLabelSupporting, styles.textAlignCenter, styles.mt1, styles.mb3]}>
{defaultMaxParticipantsReachedMessage}
</Text>
)}
{!shouldShowMaxParticipantsMessage && this.props.shouldShowOfflineMessage && this.props.network.isOffline && (
{this.props.shouldShowOfflineMessage && this.props.network.isOffline && (
<Text style={[styles.formError, styles.pb2]}>
{this.props.translate('session.offlineMessage')}
</Text>
Expand Down
1 change: 0 additions & 1 deletion src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ class NewChatPage extends Component {
shouldFocusOnSelectRow={this.props.isGroupChat}
shouldShowConfirmButton={this.props.isGroupChat}
confirmButtonText={this.props.translate('newChatPage.createGroup')}
maxParticipantsReached={maxParticipantsReached}
onConfirmSelection={this.props.isGroupChat ? this.createGroup : this.createChat}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class IOUCurrencySelection extends Component {
/**
* Returns the sections needed for the OptionsSelector
*
* @param {Boolean} maxParticipantsReached
* @returns {Array}
*/
getSections() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class IOUParticipantsSplit extends Component {
shouldDelayFocus
shouldShowConfirmButton
confirmButtonText={this.props.translate('common.next')}
maxParticipantsReached={maxParticipantsReached}
onConfirmSelection={this.finalizeParticipants}
/>
</View>
Expand Down

0 comments on commit dff9e9c

Please sign in to comment.