Wired choose plan back button on newsletter page

This commit is contained in:
Rishabh 2022-05-12 23:29:09 +05:30
parent 2e1567ac67
commit b3d2dbc9e9
2 changed files with 2 additions and 9 deletions

View File

@ -64,7 +64,7 @@ function NewsletterPrefs({subscribedNewsletters, setSubscribedNewsletters}) {
}); });
} }
export default function NewsletterSelectionPage({pageData}) { export default function NewsletterSelectionPage({pageData, onBack}) {
const {brandColor, site, onAction, action} = useContext(AppContext); const {brandColor, site, onAction, action} = useContext(AppContext);
const siteNewsletters = getSiteNewsletters({site}); const siteNewsletters = getSiteNewsletters({site});
const defaultNewsletters = siteNewsletters.filter((d) => { const defaultNewsletters = siteNewsletters.filter((d) => {
@ -122,11 +122,7 @@ export default function NewsletterSelectionPage({pageData}) {
<button <button
className='gh-portal-btn gh-portal-btn-link gh-portal-btn-different-plan' className='gh-portal-btn gh-portal-btn-link gh-portal-btn-different-plan'
onClick = {() => { onClick = {() => {
if (this.props.onBack) { onBack();
this.props.onBack();
} else {
this.context.onAction('closePopup');
}
}}> }}>
<span>Choose a different plan</span> <span>Choose a different plan</span>
</button> </button>

View File

@ -476,9 +476,6 @@ class SignupPage extends React.Component {
return ( return (
<NewsletterSelectionPage <NewsletterSelectionPage
pageData={this.state.pageData} pageData={this.state.pageData}
onSubmit={() => {
// Handle submit
}}
onBack={() => { onBack={() => {
this.setState({ this.setState({
showNewsletterSelection: false showNewsletterSelection: false