1
1
import * as React from 'react'
2
2
import { useQuery } from '@apollo/react-hooks'
3
3
import { Button , Card } from '@alifd/next'
4
+ import * as CR from 'typings'
4
5
import * as T from 'typings/graphql'
5
6
6
- import currentTutorial from '../../services/current'
7
7
// import { editorDispatch } from '../../services/vscode'
8
8
import LoadingPage from '../LoadingPage'
9
9
import queryTutorial from './queryTutorial'
@@ -29,13 +29,18 @@ export const ContinuePage = (props: Props) => (
29
29
30
30
const Loading = ( ) => < LoadingPage text = "Loading tutorials" />
31
31
32
- const ContinuePageContainer = ( ) => {
32
+ interface ContainerProps {
33
+ context :CR . MachineContext
34
+ }
35
+
36
+ const ContinuePageContainer = ( { context} :ContainerProps ) => {
33
37
// TODO: load specific tutorialId
34
- const { tutorialId, version} = currentTutorial . get ( )
38
+ const { tutorial} = context
39
+ // const { tutorialId, version } = currentTutorial.get()
35
40
const { data, loading, error} = useQuery ( queryTutorial , {
36
41
variables :{
37
- tutorialId,
38
- version,
42
+ tutorialId : tutorial . id ,
43
+ version : tutorial . version . version ,
39
44
} ,
40
45
} )
41
46