diff options
Diffstat (limited to 'ui/app/higher-order-components/initialized/initialized.component.js')
-rw-r--r-- | ui/app/higher-order-components/initialized/initialized.component.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/app/higher-order-components/initialized/initialized.component.js b/ui/app/higher-order-components/initialized/initialized.component.js new file mode 100644 index 000000000..0736ceff4 --- /dev/null +++ b/ui/app/higher-order-components/initialized/initialized.component.js @@ -0,0 +1,14 @@ +import React from 'react' +import PropTypes from 'prop-types' +import { Redirect, Route } from 'react-router-dom' +import { INITIALIZE_ROUTE } from '../../routes' + +export default function Initialized (props) { + return props.completedOnboarding + ? <Route { ...props } /> + : <Redirect to={{ pathname: INITIALIZE_ROUTE }} /> +} + +Initialized.propTypes = { + completedOnboarding: PropTypes.bool, +} |