Skip to content

Commit 90c054b

Browse files
authoredJun 10, 2019
Merge pull request #5 from ShMcK/feature/new-continue
Feature/new continue
·
v0.19.40.2.0
2 parents bf04c34 + 7c2bd8f commit 90c054b

File tree

27 files changed

+243
-275
lines changed

27 files changed

+243
-275
lines changed
 

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"compile": "tsc -p ./",
3333
"watch": "tsc -watch -p ./",
3434
"postinstall": "node ./node_modules/vscode/bin/install",
35+
"storybook": "cd web-app && npm run storybook",
3536
"test": "npm run build && node ./node_modules/vscode/bin/test"
3637
},
3738
"devDependencies": {

‎src/editor/commands/index.ts

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import * as vscode from 'vscode'
22
import { join } from 'path'
33
import { setStorage } from '../storage'
44
import ReactWebView from '../ReactWebView'
5+
import { isEmptyWorkspace } from '../workspace'
56
import * as CR from 'typings'
67

78
const COMMANDS = {
89
START: 'coderoad.start',
9-
NEW_OR_CONTINUE: 'coderoad.new_or_continue',
10+
TUTORIAL_LAUNCH: 'coderoad.tutorial_launch',
1011
OPEN_WEBVIEW: 'coderoad.open_webview',
1112
SEND_STATE: 'coderoad.send_state',
1213
SEND_DATA: 'coderoad.send_data',
@@ -20,12 +21,13 @@ interface CreateCommandProps {
2021
machine: CR.StateMachine,
2122
storage: any,
2223
git: any
24+
position: any
2325
}
2426

2527
// React panel webview
2628
let webview: any;
2729

28-
export const createCommands = ({ context, machine, storage, git }: CreateCommandProps) => ({
30+
export const createCommands = ({ context, machine, storage, git, position }: CreateCommandProps) => ({
2931
// initialize
3032
[COMMANDS.START]: () => {
3133
// set local storage workspace
@@ -36,25 +38,30 @@ export const createCommands = ({ context, machine, storage, git }: CreateCommand
3638
console.log('webview', webview.panel.webview.postMessage)
3739
machine.activate()
3840
},
39-
[COMMANDS.NEW_OR_CONTINUE]: async () => {
40-
// verify that the user has a tutorial & progress
41-
// verify git is setup with a coderoad remote
42-
const [tutorial, progress, hasGit, hasGitRemote] = await Promise.all([
43-
storage.getTutorial(),
44-
storage.getProgress(),
45-
git.gitVersion(),
46-
git.gitCheckRemoteExists(),
47-
])
48-
const canContinue = !!(tutorial && progress && hasGit && hasGitRemote)
49-
console.log('canContinue', canContinue)
50-
// if a tutorial exists, 'CONTINUE'
51-
// otherwise start from 'NEW'
52-
machine.send(canContinue ? 'CONTINUE' : 'NEW')
53-
},
5441
// open React webview
5542
[COMMANDS.OPEN_WEBVIEW]: (column: number = vscode.ViewColumn.One) => {
5643
webview.createOrShow(column);
5744
},
45+
// launch a new tutorial
46+
// NOTE: may be better to move into action as logic is primarily non-vscode
47+
[COMMANDS.TUTORIAL_LAUNCH]: async (tutorial: CR.Tutorial) => {
48+
console.log('launch tutorial')
49+
50+
await isEmptyWorkspace()
51+
52+
await git.gitInitIfNotExists()
53+
54+
// TODO: use actual tutorial repo
55+
await Promise.all([git.gitSetupRemote(tutorial.meta.repo), storage.setTutorial(tutorial), storage.resetProgress()])
56+
57+
// TODO: refactor to allow client to call initialization
58+
const pos: CR.Position = await position.getInitial(tutorial)
59+
60+
// eslint-disable-next-line
61+
const { steps } = tutorial.data
62+
const { setup } = steps[pos.stepId].actions
63+
await git.gitLoadCommits(setup)
64+
},
5865
// open a file
5966
[COMMANDS.OPEN_FILE]: async (relativeFilePath: string) => {
6067
console.log(`OPEN_FILE ${JSON.stringify(relativeFilePath)}`)
@@ -79,6 +86,6 @@ export const createCommands = ({ context, machine, storage, git }: CreateCommand
7986
},
8087
[COMMANDS.RECEIVE_ACTION]: (action: string | CR.Action) => {
8188
console.log('onReceiveAction', action)
82-
machine.onReceive(action)
89+
machine.send(action)
8390
}
8491
})

‎src/editor/commands/start-old.ts

Lines changed: 0 additions & 108 deletions
This file was deleted.

‎src/editor/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as CR from 'typings'
33
import { createCommands } from './commands'
44
import * as storage from '../services/storage'
55
import * as git from '../services/git'
6+
import * as position from '../services/position'
67

78
interface Props {
89
machine: CR.StateMachine,
@@ -33,6 +34,7 @@ class Editor {
3334
machine: this.machine,
3435
storage,
3536
git,
37+
position,
3638
})
3739
for (const cmd in commands) {
3840
const command: vscode.Disposable = vscode.commands.registerCommand(cmd, commands[cmd])

‎src/services/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as CR from 'typings'
22

33
// temporary tutorials
4-
import basicTutorial from '../../state/context/tutorials/basic'
4+
import basicTutorial from 'tutorials/basic'
55

66
interface Options {
77
resource: string

‎src/state/actions/index.ts

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { assign } from 'xstate'
2+
// NOTE: codesmell - importing machine
3+
import { machine } from '../../extension'
4+
import api from '../../services/api'
25
import * as CR from 'typings'
36
import * as vscode from 'vscode'
7+
import * as storage from '../../services/storage'
8+
import * as git from '../../services/git'
49

510
let initialTutorial: CR.Tutorial | undefined
611
let initialProgress: CR.Progress = {
@@ -11,7 +16,34 @@ let initialProgress: CR.Progress = {
1116
}
1217

1318
export default {
14-
tutorialLoad: assign({
19+
createWebview() {
20+
console.log('execute coderoad.open_webview')
21+
vscode.commands.executeCommand('coderoad.open_webview')
22+
},
23+
async newOrContinue() {
24+
// verify that the user has a tutorial & progress
25+
// verify git is setup with a coderoad remote
26+
const [tutorial, progress, hasGit, hasGitRemote] = await Promise.all([
27+
storage.getTutorial(),
28+
storage.getProgress(),
29+
git.gitVersion(),
30+
git.gitCheckRemoteExists(),
31+
])
32+
const canContinue = !!(tutorial && progress && hasGit && hasGitRemote)
33+
34+
if (canContinue) {
35+
initialTutorial = tutorial
36+
initialProgress = progress
37+
}
38+
39+
machine.send(canContinue ? 'CONTINUE' : 'NEW')
40+
},
41+
async tutorialLaunch() {
42+
// TODO: add selection of tutorial id
43+
const tutorial: CR.Tutorial = await api({ resource: 'getTutorial', params: { id: '1' } })
44+
vscode.commands.executeCommand('coderoad.tutorial_launch', tutorial)
45+
},
46+
tutorialContinue: assign({
1547
// load initial data, progress & position
1648
data(): CR.TutorialData {
1749
console.log('ACTION: tutorialLoad.data')
@@ -45,11 +77,4 @@ export default {
4577
return position
4678
}
4779
}),
48-
createWebview() {
49-
console.log('execute coderoad.open_webview')
50-
vscode.commands.executeCommand('coderoad.open_webview')
51-
},
52-
newOrContinue() {
53-
vscode.commands.executeCommand('coderoad.new_or_continue')
54-
}
5580
}

‎src/state/context/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import basicTutorialData from './tutorials/basic'
1+
import basicTutorialData from 'tutorials/basic'
22
import * as CR from 'typings'
33

44
const tutorialContext: CR.MachineContext = {

‎src/state/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ class StateMachine {
3636
this.service.stop()
3737
}
3838
send(action: string | CR.Action) {
39-
console.log('machine.send')
40-
console.log(action)
41-
this.service.send(action)
42-
}
43-
onReceive(action: string | CR.Action) {
44-
console.log(action)
4539
this.service.send(action)
4640
}
4741
}

‎src/state/machine.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const machine = Machine<
1111
CR.MachineEvent
1212
>(
1313
{
14-
id: 'tutorial',
14+
id: 'root',
1515
context: initialContext,
1616
initial: 'SelectTutorial',
1717
states: {
@@ -40,28 +40,28 @@ export const machine = Machine<
4040
},
4141
},
4242
InitializeTutorial: {
43+
onEntry: ['tutorialLaunch'],
4344
on: {
44-
TUTORIAL_LOADED: 'Tutorial'
45+
TUTORIAL_LOADED: '#tutorial'
4546
}
4647
},
4748
}
48-
4949
},
5050
ContinueTutorial: {
51-
onEntry: 'tutorialLoad',
51+
onEntry: ['tutorialContinue'],
5252
on: {
53-
TUTORIAL_START: {
54-
target: 'Tutorial.LoadNext',
55-
}
53+
TUTORIAL_START: '#tutorial-load-next'
5654
}
5755
},
5856
}
5957
},
6058
Tutorial: {
59+
id: 'tutorial',
6160
initial: 'Summary',
6261
states: {
6362
LoadNext: {
64-
onEntry: () => send('LOAD_NEXT'),
63+
id: 'tutorial-load-next',
64+
// onEntry: [() => send('LOAD_NEXT')],
6565
on: {
6666
LOAD_NEXT: [
6767
{
@@ -144,7 +144,7 @@ export const machine = Machine<
144144
cond: 'hasNextLevel',
145145
},
146146
{
147-
target: 'EndTutorial',
147+
target: '#root.Tutorial.EndTutorial',
148148
},
149149
],
150150
},

‎src/state/message.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dom"
99
],
1010
"sourceMap": true,
11-
"rootDir": "src",
11+
"rootDirs": ["src", "tutorials"],
1212
"baseUrl": "src",
1313
"strict": true, /* enable all strict type-checking options */
1414
/* Additional Checks */
@@ -23,6 +23,9 @@
2323
"emitDecoratorMetadata": true,
2424
"paths": {
2525
"typings": ["../typings/index.d.ts"],
26+
"tutorials/basic": [
27+
"../tutorials/basic.ts"
28+
]
2629
},
2730
},
2831
"exclude": [

‎src/state/context/tutorials/basic.ts renamed to ‎tutorials/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const basic: CR.Tutorial = {
44
id: 'tutorialId',
55
meta: {
66
version: '0.1.0',
7-
repo: 'https://github.com/ShMcK/coderoad-vscode.git',
7+
repo: 'https://github.com/ShMcK/coderoad-tutorial-basic.git',
88
createdBy: 'shmck',
99
createdAt: 'Sat, 11 May 2019 18:25:24 GMT',
1010
updatedBy: 'shmck',

‎typings/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,4 @@ export interface StateMachine {
168168
activate(): void
169169
deactivate(): void
170170
send(action: string | Action): void
171-
onReceive(action: string | Action): void
172171
}

‎web-app/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
printWidth: 120,
3+
semi: false,
4+
singleQuote: true,
5+
tabWidth: 2,
6+
trailingComma: 'all',
7+
}

‎web-app/src/App.tsx

Lines changed: 42 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,54 @@ import * as CR from 'typings'
33

44
import Debugger from './components/Debugger'
55
import Routes from './Routes'
6+
import DataContext, { initialState, initialData } from './utils/DataContext'
67

78
interface ReceivedEvent {
8-
data: CR.Action
9+
data: CR.Action
910
}
1011

11-
const initialState = { SelectTutorial: 'Initial '}
12-
const initialData: CR.MachineContext = {
13-
position: { levelId: '', stageId: '', stepId: '' },
14-
data: {
15-
summary: {
16-
title: '',
17-
description: '',
18-
levelList: [],
19-
},
20-
levels: {},
21-
stages: {},
22-
steps: {},
23-
},
24-
progress: { levels: {}, stages: {}, steps: {}, complete: false },
25-
}
26-
27-
const DataContext = React.createContext({ state: initialState, ...initialData })
28-
29-
30-
3112
const App = () => {
32-
const [state, setState] = React.useState(initialState)
33-
const [data, setData]: [CR.MachineContext, (data: CR.MachineContext) => void] = React.useState(initialData)
34-
35-
const handleEvent = (event: ReceivedEvent): void => {
36-
const message = event.data
37-
console.log('RECEIVED')
38-
console.log(message)
39-
// messages from core
40-
if (message.type === 'SET_STATE') {
41-
setState(message.payload.state)
42-
setData(message.payload.data)
43-
} else if (message.type === 'SET_DATA') {
44-
setData(message.payload.data)
45-
}
13+
const [state, setState] = React.useState(initialState)
14+
const [data, setData]: [CR.MachineContext, (data: CR.MachineContext) => void] = React.useState(initialData)
15+
16+
const handleEvent = (event: ReceivedEvent): void => {
17+
const message = event.data
18+
console.log('RECEIVED')
19+
console.log(message)
20+
// messages from core
21+
if (message.type === 'SET_STATE') {
22+
setState(message.payload.state)
23+
setData(message.payload.data)
24+
} else if (message.type === 'SET_DATA') {
25+
setData(message.payload.data)
4626
}
47-
48-
// event bus listener
49-
React.useEffect(() => {
50-
const listener = 'message'
51-
window.addEventListener(listener, handleEvent)
52-
return () => {
53-
window.removeEventListener(listener, handleEvent)
54-
}
55-
})
56-
57-
const value = {
58-
state,
59-
position: data.position,
60-
data: data.data,
61-
progress: data.progress,
27+
}
28+
29+
// event bus listener
30+
React.useEffect(() => {
31+
const listener = 'message'
32+
window.addEventListener(listener, handleEvent)
33+
return () => {
34+
window.removeEventListener(listener, handleEvent)
6235
}
63-
64-
// TODO: refactor cond to user <Router><Route> and accept first route as if/else if
65-
return (
66-
<DataContext.Provider value={value}>
67-
<div>
68-
<Debugger value={value} />
69-
<Routes state={state} />
70-
</div>
71-
</DataContext.Provider>
72-
)
36+
})
37+
38+
const value = {
39+
state,
40+
position: data.position,
41+
data: data.data,
42+
progress: data.progress,
43+
}
44+
45+
// TODO: refactor cond to user <Router><Route> and accept first route as if/else if
46+
return (
47+
<DataContext.Provider value={value}>
48+
<div>
49+
<Debugger value={value} />
50+
<Routes state={state} />
51+
</div>
52+
</DataContext.Provider>
53+
)
7354
}
7455

75-
export default App
56+
export default App

‎web-app/src/Routes.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
import * as React from 'react'
2-
import { send } from './utils/vscode'
32

3+
import Loading from './components/Loading'
44
import Cond from './components/Cond'
55
import NewPage from './containers/New'
66
import ContinuePage from './containers/Continue'
7-
7+
import TutorialPage from './containers/Tutorial'
88

99
interface Props {
1010
state: any
1111
}
1212

1313
const Routes = ({ state }: Props) => {
14-
// TODO: refactor cond to user <Router><Route> and accept first route as if/else if
15-
return (
16-
<div>
17-
<Cond state={state} path="SelectTutorial.NewTutorial">
18-
<NewPage onNew={() => send('TUTORIAL_START')} />
19-
</Cond>
20-
<Cond state={state} path="SelectTutorial.ContinueTutorial">
21-
<ContinuePage onContinue={() => console.log('continue!')} tutorials={[]} />
22-
</Cond>
23-
</div>
24-
)
14+
// TODO: refactor cond to user <Router><Route> and accept first route as if/else if
15+
return (
16+
<div>
17+
<Cond state={state} path="SelectTutorial.Startup">
18+
<Loading />
19+
</Cond>
20+
<Cond state={state} path="SelectTutorial.NewTutorial">
21+
<NewPage />
22+
</Cond>
23+
<Cond state={state} path="SelectTutorial.ContinueTutorial">
24+
<ContinuePage />
25+
</Cond>
26+
<Cond state={state} path="Tutorial">
27+
<TutorialPage />
28+
</Cond>
29+
</div>
30+
)
2531
}
2632

27-
export default Routes
33+
export default Routes

‎web-app/src/components/Cond/utils/state.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
export function stateMatch(state: any, statePath: string) {
22
let current = state
33
let paths = statePath.split('.')
4+
let complete = false
45
try {
56
for (const p of paths) {
6-
current = current[p]
7+
if (p === current && !complete) {
8+
// handle strings
9+
complete = true
10+
} else {
11+
// handle objects
12+
current = current[p]
13+
}
714
}
815
} catch (error) {
916
return false

‎web-app/src/components/Loading/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import * as React from 'react'
2-
// import send from '../../data/send'
32

43
const Loading = () => {
5-
React.useEffect(() => {
6-
// load tutorial and progress on startup
7-
// send({ type: 'GET/TUTORIAL' })
8-
})
94
return <div>Loading...</div>
105
}
116

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
import * as React from 'react'
2-
import CR from 'typings'
3-
4-
import ContinueItem from './ContinueItem'
2+
import { send } from '../../utils/vscode'
3+
import DataContext from '../../utils/DataContext'
4+
import { Button, Card } from '@alifd/next'
55

66
interface Props {
7-
tutorials: CR.Tutorial[]
8-
onContinue(tutorialId: string): void
9-
// onReset(): void
7+
onContinue(): void
108
}
119

12-
const ContinuePage = (props: Props) => {
10+
export const ContinuePage = (props: Props) => {
1311
// context
12+
const { data } = React.useContext(DataContext)
1413
return (
1514
<div>
16-
{props.tutorials.map((tutorial: CR.Tutorial) => (
17-
<ContinueItem
18-
key={tutorial.id}
19-
onContinue={() => props.onContinue(tutorial.id)}
20-
title={tutorial.data.summary.title}
21-
description={tutorial.data.summary.description}
22-
/>
23-
))}
15+
<h3>Continue</h3>
16+
<Card showTitleBullet={false} contentHeight="auto">
17+
<div>
18+
<h2>{data.summary.title}</h2>
19+
<p>{data.summary.description}</p>
20+
<Button onClick={props.onContinue}>Resume</Button>
21+
</div>
22+
</Card>
2423
</div>
2524
)
2625
}
2726

28-
export default ContinuePage
27+
export default () => (
28+
<ContinuePage
29+
onContinue={() => {
30+
send('TUTORIAL_START')
31+
}}
32+
/>
33+
)

‎web-app/src/containers/Continue/ContinueItem.tsx renamed to ‎web-app/src/containers/New/TutorialItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface Props {
77
onContinue(): void
88
}
99

10-
const ContinueItem = (props: Props) => {
10+
const TutorialItem = (props: Props) => {
1111
return (
1212
<Card showTitleBullet={false} contentHeight="auto">
1313
<div>
@@ -19,4 +19,4 @@ const ContinueItem = (props: Props) => {
1919
)
2020
}
2121

22-
export default ContinueItem
22+
export default TutorialItem

‎web-app/src/containers/New/index.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
import * as React from 'react'
22
import { Button } from '@alifd/next'
3+
import Cond from '../../components/Cond'
4+
import DataContext from '../../utils/DataContext'
5+
import { send } from '../../utils/vscode'
36

47
interface Props {
58
onNew(tutorialId: string): void
69
}
710

8-
const NewPage = (props: Props) => {
11+
export const NewPage = (props: Props) => {
12+
const { state } = React.useContext(DataContext)
13+
const [tutorialList, setTutorialList] = React.useState([{ id: '1', title: 'Demo', description: 'A basic demo' }])
914
// context
1015
return (
1116
<div>
12-
<h2>Start a new Project</h2>
13-
<Button onClick={() => props.onNew('1')}>New</Button>
17+
<Cond state={state} path="SelectTutorial.NewTutorial.SelectTutorial">
18+
<div>
19+
<h2>Start a new Project</h2>
20+
{tutorialList.map(tutorial => (
21+
<div>
22+
<h3>{tutorial.title}</h3>
23+
<p>{tutorial.description}</p>
24+
<Button onClick={() => props.onNew(tutorial.id)}>Start</Button>
25+
</div>
26+
))}
27+
</div>
28+
</Cond>
29+
<Cond state={state} path="SelectTutorial.NewTutorial.InitializeTutorial">
30+
<div>Initializing tutorial...</div>
31+
</Cond>
1432
</div>
1533
)
1634
}
1735

18-
export default NewPage
36+
export default () => <NewPage onNew={() => send('TUTORIAL_START')} />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as React from 'react'
2+
3+
interface Props {}
4+
5+
const Tutorial = (props: Props) => {
6+
// useContext
7+
return (
8+
<div>
9+
<h3>Tutorial</h3>
10+
</div>
11+
)
12+
}
13+
14+
export default Tutorial

‎src/services/api/fetch.ts renamed to ‎web-app/src/services/api/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as CR from 'typings'
22

33
// temporary tutorials
4-
import basicTutorial from '../../state/context/tutorials/basic'
4+
import basicTutorial from 'tutorials/basic'
55

66
interface Options {
77
resource: string

‎web-app/src/utils/DataContext.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as React from 'react'
2+
import * as CR from 'typings'
3+
4+
export const initialState = { SelectTutorial: 'Initial ' }
5+
export const initialData: CR.MachineContext = {
6+
position: { levelId: '', stageId: '', stepId: '' },
7+
data: {
8+
summary: {
9+
title: '',
10+
description: '',
11+
levelList: [],
12+
},
13+
levels: {},
14+
stages: {},
15+
steps: {},
16+
},
17+
progress: { levels: {}, stages: {}, steps: {}, complete: false },
18+
}
19+
20+
const DataContext = React.createContext({ state: initialState, ...initialData })
21+
22+
export default DataContext

‎web-app/stories/Continue.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react'
33
import { storiesOf } from '@storybook/react'
44
import { action } from '@storybook/addon-actions'
55

6-
import Continue from '../src/containers/Continue'
6+
import { ContinuePage } from '../src/containers/Continue'
77
import demo from './data/basic'
88

9-
storiesOf('Continue', module).add('Page', () => <Continue tutorials={[demo]} onContinue={action('onContinue')} />)
9+
storiesOf('Continue', module).add('Page', () => <ContinuePage tutorials={[demo]} onContinue={action('onContinue')} />)

‎web-app/stories/New.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import React from 'react'
33
import { storiesOf } from '@storybook/react'
44
import { action } from '@storybook/addon-actions'
55

6-
import New from '../src/containers/New'
6+
import { NewPage } from '../src/containers/New'
77

8-
storiesOf('New', module).add('Page', () => <New onNew={action('onNew')} />)
8+
storiesOf('New', module).add('Page', () => <NewPage onNew={action('onNew')} />)

‎web-app/tsconfig.paths.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"typings": [
1010
"../../typings/index.d.ts"
1111
],
12+
"tutorials/basic": [
13+
"../../tutorials/basic.ts"
14+
]
1215
}
1316
},
1417
"exclude": [

0 commit comments

Comments
 (0)
Please sign in to comment.