Remove modal opening/closing logic from splash page

This commit is contained in:
seotts 2021-12-14 16:53:45 -05:00
parent 781deeb067
commit 4496e4fa5e
2 changed files with 0 additions and 32 deletions

View file

@ -200,28 +200,9 @@ class SplashPresentation extends React.Component { // eslint-disable-line react/
constructor (props) {
super(props);
bindAll(this, [
'handleMessage',
'renderHomepageRows'
]);
}
componentDidMount () {
if (this.props.shouldShowEmailConfirmation) window.addEventListener('message', this.handleMessage);
}
componentWillUnmount () {
window.removeEventListener('message', this.handleMessage);
}
handleMessage (e) {
if (e.origin !== window.location.origin) return;
if (e.source !== this.emailConfirmationiFrame.contentWindow) return;
if (e.data === 'resend-done') {
this.props.onHideEmailConfirmationModal();
} else {
const data = JSON.parse(e.data);
if (data.action === 'leave-page') {
window.location.href = data.uri;
}
}
}
renderHomepageRows () {
const rows = [
<Box
@ -553,7 +534,6 @@ SplashPresentation.propTypes = {
onCloseAdminPanel: PropTypes.func.isRequired,
onCloseDonateBanner: PropTypes.func.isRequired,
onDismiss: PropTypes.func.isRequired,
onHideEmailConfirmationModal: PropTypes.func.isRequired,
onOpenAdminPanel: PropTypes.func.isRequired,
onRefreshHomepageCache: PropTypes.func.isRequired,
refreshCacheStatus: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types

View file

@ -23,8 +23,6 @@ class Splash extends React.Component {
'getNews',
'handleRefreshHomepageCache',
'getHomepageRefreshStatus',
'handleShowEmailConfirmationModal',
'handleHideEmailConfirmationModal',
'handleCloseAdminPanel',
'handleCloseDonateBanner',
'handleOpenAdminPanel',
@ -36,7 +34,6 @@ class Splash extends React.Component {
adminPanelOpen: false,
dismissedDonateBanner: false,
news: [], // gets news posts from the scratch Tumblr
emailConfirmationModalOpen: false,
refreshCacheStatus: 'notrequested'
};
}
@ -123,12 +120,6 @@ class Splash extends React.Component {
handleCloseDonateBanner () {
this.setState({dismissedDonateBanner: true});
}
handleShowEmailConfirmationModal () {
this.setState({emailConfirmationModalOpen: true});
}
handleHideEmailConfirmationModal () {
this.setState({emailConfirmationModalOpen: false});
}
handleDismiss (cue) {
api({
host: '',
@ -192,7 +183,6 @@ class Splash extends React.Component {
<SplashPresentation
activity={this.props.activity}
adminPanelOpen={this.state.adminPanelOpen}
emailConfirmationModalOpen={this.state.emailConfirmationModalOpen}
featuredGlobal={this.props.featured}
inStudiosFollowing={this.props.studios}
isAdmin={this.props.isAdmin}
@ -212,10 +202,8 @@ class Splash extends React.Component {
onCloseDonateBanner={this.handleCloseDonateBanner}
onCloseAdminPanel={this.handleCloseAdminPanel}
onDismiss={this.handleDismiss}
onHideEmailConfirmationModal={this.handleHideEmailConfirmationModal}
onOpenAdminPanel={this.handleOpenAdminPanel}
onRefreshHomepageCache={this.handleRefreshHomepageCache}
onShowEmailConfirmationModal={this.handleShowEmailConfirmationModal}
/>
);
}