Add context to import entrypoint
[MAILPOET-2389]
This commit is contained in:
committed by
Jack Kitterhing
parent
8dba06f8b9
commit
6ce548ef1b
@@ -5,6 +5,7 @@ import {
|
||||
} from 'react-router-dom';
|
||||
import ScrollToTop from 'common/scroll_to_top.jsx';
|
||||
|
||||
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
|
||||
import StepMethodSelection from './import/step_method_selection.jsx';
|
||||
import StepInputValidation from './import/step_input_validation.jsx';
|
||||
import StepDataManipulation from './import/step_data_manipulation.jsx';
|
||||
@@ -17,62 +18,65 @@ const subscribersLimitForValidation = 200;
|
||||
const ImportSubscribers = () => {
|
||||
const [stepMethodSelectionData, setStepMethodSelectionData] = useState(undefined);
|
||||
const [stepDataManipulationData, setStepDataManipulationData] = useState({});
|
||||
const contextValue = useGlobalContextValue(window);
|
||||
return (
|
||||
<HashRouter>
|
||||
<ScrollToTop>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/step_method_selection"
|
||||
render={(props) => (
|
||||
<StepMethodSelection
|
||||
{...props}
|
||||
setStepMethodSelectionData={setStepMethodSelectionData}
|
||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_input_validation"
|
||||
render={(props) => (
|
||||
<StepInputValidation
|
||||
{...props}
|
||||
stepMethodSelectionData={stepMethodSelectionData}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_data_manipulation"
|
||||
render={(props) => (
|
||||
<StepDataManipulation
|
||||
{...props}
|
||||
stepMethodSelectionData={stepMethodSelectionData}
|
||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||
setStepDataManipulationData={setStepDataManipulationData}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_results"
|
||||
render={(props) => (
|
||||
<StepResults
|
||||
{...props}
|
||||
errors={stepDataManipulationData.errors}
|
||||
createdSubscribers={stepDataManipulationData.created}
|
||||
updatedSubscribers={stepDataManipulationData.updated}
|
||||
segments={stepDataManipulationData.segments}
|
||||
addedToSegmentWithWelcomeNotification={
|
||||
<GlobalContext.Provider value={contextValue}>
|
||||
<HashRouter>
|
||||
<ScrollToTop>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/step_method_selection"
|
||||
render={(props) => (
|
||||
<StepMethodSelection
|
||||
{...props}
|
||||
setStepMethodSelectionData={setStepMethodSelectionData}
|
||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_input_validation"
|
||||
render={(props) => (
|
||||
<StepInputValidation
|
||||
{...props}
|
||||
stepMethodSelectionData={stepMethodSelectionData}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_data_manipulation"
|
||||
render={(props) => (
|
||||
<StepDataManipulation
|
||||
{...props}
|
||||
stepMethodSelectionData={stepMethodSelectionData}
|
||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||
setStepDataManipulationData={setStepDataManipulationData}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/step_results"
|
||||
render={(props) => (
|
||||
<StepResults
|
||||
{...props}
|
||||
errors={stepDataManipulationData.errors}
|
||||
createdSubscribers={stepDataManipulationData.created}
|
||||
updatedSubscribers={stepDataManipulationData.updated}
|
||||
segments={stepDataManipulationData.segments}
|
||||
addedToSegmentWithWelcomeNotification={
|
||||
stepDataManipulationData.added_to_segment_with_welcome_notification
|
||||
}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="*"
|
||||
render={() => <Redirect to="/step_method_selection" />}
|
||||
/>
|
||||
</Switch>
|
||||
</ScrollToTop>
|
||||
</HashRouter>
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="*"
|
||||
render={() => <Redirect to="/step_method_selection" />}
|
||||
/>
|
||||
</Switch>
|
||||
</ScrollToTop>
|
||||
</HashRouter>
|
||||
</GlobalContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user