import '@automattic/calypso-polyfills'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; import { Component } from 'react'; import RenderDom from 'react-dom'; import Main from 'calypso/components/main'; import InvalidActionPage from './invalid-action'; import RegistrantVerificationPage from './registrant-verification'; import TransferAwayConfirmationPage from './transfer-away-confirmation'; import 'calypso/assets/stylesheets/style.scss'; import './style.scss'; class DomainsLandingPage extends Component { static propTypes = { action: PropTypes.string.isRequired, query: PropTypes.object.isRequired, }; renderRegistrantVerificationContent() { // The reseller parameter is optional and contains the name of the DSAPI reseller that the domain was registered with const { domain, email, reseller, token } = this.props.query; return ( ); } renderTransferAwayConfirmation() { const { domain, recipient_id, token } = this.props.query; return ( ); } renderUnknownActionContent() { return ; } renderContent() { switch ( this.props.action ) { case 'registrant-verification': return this.renderRegistrantVerificationContent(); case 'transfer-away-confirmation': return this.renderTransferAwayConfirmation(); case 'unknown-action': default: return this.renderUnknownActionContent(); } } render() { return
{ this.renderContent() }
; } } /** * Default export. Boots up the landing page. */ function boot() { if ( window.i18nLocaleStrings ) { const i18nLocaleStringsObject = JSON.parse( window.i18nLocaleStrings ); i18n.setLocale( i18nLocaleStringsObject ); } RenderDom.render( , document.getElementById( 'primary' ) ); } boot();