aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/helpers/higher-order-components/initialized/initialized.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/helpers/higher-order-components/initialized/initialized.component.js')
-rw-r--r--ui/app/helpers/higher-order-components/initialized/initialized.component.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/app/helpers/higher-order-components/initialized/initialized.component.js b/ui/app/helpers/higher-order-components/initialized/initialized.component.js
new file mode 100644
index 000000000..2042c0046
--- /dev/null
+++ b/ui/app/helpers/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 '../../constants/routes'
+
+export default function Initialized (props) {
+ return props.completedOnboarding
+ ? <Route { ...props } />
+ : <Redirect to={{ pathname: INITIALIZE_ROUTE }} />
+}
+
+Initialized.propTypes = {
+ completedOnboarding: PropTypes.bool,
+}