-
Notifications
You must be signed in to change notification settings - Fork 3k
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 bug with The close button linked to "Request money. Get $250" is not functioning #36068
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,9 +41,6 @@ const propTypes = { | |
/** Whether referral CTA should be displayed */ | ||
shouldShowReferralCTA: PropTypes.bool, | ||
|
||
/** A method triggered when the user closes the call to action banner */ | ||
onCallToActionClosed: PropTypes.func, | ||
|
||
/** Referral content type */ | ||
referralContentType: PropTypes.string, | ||
|
||
|
@@ -56,7 +53,6 @@ const propTypes = { | |
const defaultProps = { | ||
shouldDelayFocus: false, | ||
shouldShowReferralCTA: false, | ||
onCallToActionClosed: () => {}, | ||
referralContentType: CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND, | ||
safeAreaPaddingBottomStyle: {}, | ||
contentContainerStyles: [], | ||
|
@@ -72,7 +68,6 @@ class BaseOptionsSelector extends Component { | |
this.updateFocusedIndex = this.updateFocusedIndex.bind(this); | ||
this.scrollToIndex = this.scrollToIndex.bind(this); | ||
this.selectRow = this.selectRow.bind(this); | ||
this.closeReferralModal = this.closeReferralModal.bind(this); | ||
this.selectFocusedOption = this.selectFocusedOption.bind(this); | ||
this.addToSelection = this.addToSelection.bind(this); | ||
this.updateSearchValue = this.updateSearchValue.bind(this); | ||
|
@@ -95,7 +90,6 @@ class BaseOptionsSelector extends Component { | |
allOptions, | ||
focusedIndex, | ||
shouldDisableRowSelection: false, | ||
shouldShowReferralModal: this.props.shouldShowReferralCTA, | ||
errorMessage: '', | ||
paginationPage: 1, | ||
disableEnterShortCut: false, | ||
|
@@ -266,11 +260,6 @@ class BaseOptionsSelector extends Component { | |
this.props.onChangeText(value); | ||
} | ||
|
||
closeReferralModal() { | ||
this.setState((prevState) => ({shouldShowReferralModal: !prevState.shouldShowReferralModal})); | ||
this.props.onCallToActionClosed(this.props.referralContentType); | ||
} | ||
|
||
Comment on lines
-269
to
-273
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a leftover this.closeReferralModal = this.closeReferralModal.bind(this); This should be removed |
||
handleFocusIn() { | ||
const activeElement = document.activeElement; | ||
this.setState({ | ||
|
@@ -653,12 +642,9 @@ class BaseOptionsSelector extends Component { | |
</> | ||
)} | ||
</View> | ||
{this.props.shouldShowReferralCTA && this.state.shouldShowReferralModal && ( | ||
{this.props.shouldShowReferralCTA && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm actually not sure about this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually ignore this comment. I think it's better to keep BaseOptionsSelector onyx-free |
||
<View style={[this.props.themeStyles.ph5, this.props.themeStyles.pb5, this.props.themeStyles.flexShrink0]}> | ||
<ReferralProgramCTA | ||
referralContentType={this.props.referralContentType} | ||
onCloseButtonPress={this.closeReferralModal} | ||
/> | ||
<ReferralProgramCTA referralContentType={this.props.referralContentType} /> | ||
</View> | ||
)} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the default value too (defaultProps)