@@ -4,7 +4,6 @@ import * as T from 'typings/graphql'
44import * as CR from 'typings'
55
66import queryTutorials from './queryTutorials'
7- import { editorDispatch } from '../../services/vscode'
87import LoadingPage from '../LoadingPage'
98import ErrorView from '../../components/Error'
109import TutorialList from './TutorialList'
@@ -16,26 +15,35 @@ interface Props {
1615
1716export const NewPage = ( props :Props ) => (
1817< div >
19- < h2 > Start anew Project </ h2 >
18+ < h2 > Start aNew Tutorial </ h2 >
2019< TutorialList tutorialList = { props . tutorialList } onNew = { props . onNew } />
2120</ div >
2221)
2322
2423const Loading = ( ) => < LoadingPage text = "Loading tutorials" />
2524
26- const NewPageContainer = ( ) => {
25+ interface ContainerProps {
26+ send ?( action :CR . Action ) :void
27+ }
28+
29+ const NewPageContainer = ( props :ContainerProps ) => {
30+ console . log ( 'props' , props )
2731const { data, loading, error} = useQuery ( queryTutorials )
2832if ( loading ) {
2933return < Loading />
3034}
3135
3236if ( error ) {
3337return < ErrorView error = { error } />
34- }
38+ }
39+
40+ // TODO: cleanup React.cloneElement props issue
41+ const sendFallback = ( action :CR . Action ) => console . log ( 'Cannot send' )
42+ const send = props . send || sendFallback
3543
3644return (
3745< React . Suspense fallback = { Loading } >
38- < NewPage onNew = { editorDispatch } tutorialList = { data . tutorials } />
46+ < NewPage onNew = { send } tutorialList = { data . tutorials } />
3947</ React . Suspense >
4048)
4149}