{
const Container = styled(Box).attrs({
bg: 'white',
- p: 6,
- align: 'center',
- justify: 'center',
})`
position: fixed;
top: 0;
@@ -128,18 +100,4 @@ const Container = styled(Box).attrs({
z-index: 100;
`
-const Inner = styled(Box).attrs({
- bg: 'lightGraphite',
- p: 4,
-})`
- border: 1px solid rgba(0, 0, 0, 0.1);
- height: 400px;
- width: 400px;
- border-radius: 3px;
-`
-
-const StepTitle = styled(Box).attrs({
- fontSize: 8,
-})``
-
export default compose(connect(mapStateToProps, mapDispatchToProps), translate())(Onboarding)
diff --git a/src/components/Onboarding/steps/Init.js b/src/components/Onboarding/steps/Init.js
new file mode 100644
index 00000000..76ae3cb3
--- /dev/null
+++ b/src/components/Onboarding/steps/Init.js
@@ -0,0 +1,18 @@
+// @flow
+
+import React from 'react'
+
+import Button from 'components/base/Button'
+import Box from 'components/base/Box'
+
+import type { StepProps } from '..'
+
+export default (props: StepProps) => {
+ const { nextStep } = props
+ return (
+
+ hey im step init
+
+
+ )
+}
diff --git a/src/components/Onboarding/steps/UserChoice.js b/src/components/Onboarding/steps/UserChoice.js
new file mode 100644
index 00000000..a4d407a8
--- /dev/null
+++ b/src/components/Onboarding/steps/UserChoice.js
@@ -0,0 +1,17 @@
+// @flow
+
+import React from 'react'
+
+import Button from 'components/base/Button'
+
+import type { StepProps } from '..'
+
+export default (props: StepProps) => {
+ const { jumpStep } = props
+ return (
+
+ hey im step user choice
+
+
+ )
+}
diff --git a/src/reducers/index.js b/src/reducers/index.js
index 5963f822..a73be396 100644
--- a/src/reducers/index.js
+++ b/src/reducers/index.js
@@ -13,6 +13,7 @@ import devices from './devices'
import modals from './modals'
import settings from './settings'
import update from './update'
+import onboarding from './onboarding'
import type { AccountsState } from './accounts'
import type { ApplicationState } from './application'
@@ -20,6 +21,7 @@ import type { DevicesState } from './devices'
import type { ModalsState } from './modals'
import type { SettingsState } from './settings'
import type { UpdateState } from './update'
+import type { OnboardingState } from './onboarding'
export type State = {
accounts: AccountsState,
@@ -30,6 +32,7 @@ export type State = {
router: LocationShape,
settings: SettingsState,
update: UpdateState,
+ onboarding: OnboardingState,
}
export default combineReducers({
@@ -41,4 +44,5 @@ export default combineReducers({
router,
settings,
update,
+ onboarding,
})
diff --git a/src/reducers/onboarding.js b/src/reducers/onboarding.js
new file mode 100644
index 00000000..22a24fa3
--- /dev/null
+++ b/src/reducers/onboarding.js
@@ -0,0 +1,84 @@
+// @flow
+
+import { handleActions, createAction } from 'redux-actions'
+
+type Step = {
+ name: string,
+ external?: boolean,
+ label?: string,
+ options: {
+ showFooter: boolean,
+ showBackground: boolean,
+ showBreadcrumb: boolean,
+ },
+}
+
+export type OnboardingState = {
+ stepIndex: number,
+ stepName: string, // TODO: specify that the string comes from Steps type
+ steps: Step[],
+}
+
+const state: OnboardingState = {
+ stepIndex: 0,
+ stepName: 'init',
+ steps: [
+ {
+ name: 'init',
+ external: true,
+ options: {
+ showFooter: false,
+ showBackground: true,
+ showBreadcrumb: false,
+ },
+ },
+ {
+ name: 'userChoice',
+ label: 'something:translated',
+ options: {
+ showFooter: false,
+ showBackground: true,
+ showBreadcrumb: true,
+ },
+ },
+ ],
+}
+
+const handlers = {
+ ONBOARDING_NEXT_STEP: state => {
+ const step = state.steps.find(step => step.name === state.stepName)
+ if (!step) {
+ return state
+ }
+ const index = state.steps.indexOf(step)
+ if (index > state.steps.length - 2) {
+ return state
+ }
+ return { ...state, stepName: state.steps[index + 1].name, stepIndex: index + 1 }
+ },
+ ONBOARDING_PREV_STEP: state => {
+ const step = state.steps.find(step => step.name === state.stepName)
+ if (!step) {
+ return state
+ }
+ const index = state.steps.indexOf(step)
+ if (index < 1) {
+ return state
+ }
+ return { ...state, stepName: state.steps[index - 1].name, stepIndex: index - 1 }
+ },
+ ONBOARDING_JUMP_STEP: (state, { payload: stepName }) => {
+ const step = state.steps.find(step => step.name === stepName)
+ if (!step) {
+ return state
+ }
+ const index = state.steps.indexOf(step)
+ return { ...state, stepName: step.name, stepIndex: index }
+ },
+}
+
+export default handleActions(handlers, state)
+
+export const nextStep = createAction('ONBOARDING_NEXT_STEP')
+export const prevStep = createAction('ONBOARDING_PREV_STEP')
+export const jumpStep = createAction('ONBOARDING_JUMP_STEP')