Add page for permissions asking

[MAILPOET-1856]
This commit is contained in:
Pavel Dohnal
2019-05-13 13:43:10 +02:00
committed by M. Shull
parent 5d1623a083
commit 4f42537fe7
6 changed files with 78 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
import React from 'react';
function RevenueTrackingPermission() {
return (
<div className="mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column">
<div className="mailpoet_welcome_wizard_header">
<img src={window.mailpoet_logo_url} width="200" height="87" alt="MailPoet logo"/>
</div>
<h1>This is the page</h1>
</div>
);
}
export default RevenueTrackingPermission;

View File

@@ -3,17 +3,24 @@ import ReactDOM from 'react-dom';
import { Route, HashRouter, Redirect } from 'react-router-dom';
import WelcomeWizardStepsController from './welcome_wizard_controller.jsx';
import WooCommerceImportController from './woocommerce_import_controller.jsx';
import RevenueTrackingPermissionController from './revenue_tracking_permission.jsx';
const container = document.getElementById('mailpoet_wizard_container');
if (container) {
const basePath = window.location.search.includes('woocommerce-list-import') ? '/import' : '/steps/1';
let basePath = '/steps/1';
if (window.location.search.includes('revenue-tracking-permission')) {
basePath = '/revenue-tracking-permission';
} else if (window.location.search.includes('woocommerce-list-import')) {
basePath = '/import';
}
ReactDOM.render((
<HashRouter>
<div>
<Route exact path="/" render={() => <Redirect to={basePath} />} />
<Route path="/steps/:step" component={WelcomeWizardStepsController} />
<Route path="/import" component={WooCommerceImportController} />
<Route path="/revenue-tracking-permission" component={RevenueTrackingPermissionController} />
</div>
</HashRouter>
), container);