1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/helpers/higher-order-components/initialized/initialized.component.js
Alex Donesky 9355fb21c7
Establish onboarding-flow wrapper/router base and feature flag env variable (#12247)
* establish onboarding-flow wrapper/router base and feature flag env variable

* small cleanup

* addressing feedback
2021-09-30 16:34:11 -05:00

23 lines
531 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { Redirect, Route } from 'react-router-dom';
import { INITIALIZE_ROUTE, ONBOARDING_ROUTE } from '../../constants/routes';
export default function Initialized(props) {
return props.completedOnboarding ? (
<Route {...props} />
) : (
<Redirect
to={{
pathname: process.env.ONBOARDING_V2
? ONBOARDING_ROUTE
: INITIALIZE_ROUTE,
}}
/>
);
}
Initialized.propTypes = {
completedOnboarding: PropTypes.bool,
};