11import * as React from 'react'
22import { useQuery } from '@apollo/react-hooks'
33import * as G from 'typings/graphql'
4- import * as CR from 'typings'
4+ import * as T from 'typings'
55
66import queryTutorials from '../../services/apollo/queries/tutorials'
77import NewPage from './NewPage'
88import LoadingPage from '../LoadingPage'
99import ErrorView from '../../components/Error'
1010
11- const Loading = ( ) => < LoadingPage text = "Loading tutorials" />
12-
1311interface ContainerProps {
14- send ( action :CR . Action ) :void
12+ send ( action :T . Action ) :void
13+ context :T . MachineContext
1514}
1615
1716interface TutorialsData {
@@ -20,23 +19,20 @@ interface TutorialsData {
2019
2120const NewPageContainer = ( props :ContainerProps ) => {
2221const { data, loading, error} = useQuery < TutorialsData > ( queryTutorials )
23- if ( loading ) {
24- return < Loading />
25- }
2622
2723if ( error ) {
2824return < ErrorView error = { error } />
2925}
3026
27+ if ( loading ) {
28+ return < LoadingPage text = "Loading tutorials" context = { props . context } />
29+ }
30+
3131if ( ! data ) {
3232return null
3333}
3434
35- return (
36- < React . Suspense fallback = { Loading } >
37- < NewPage tutorialList = { data . tutorials } />
38- </ React . Suspense >
39- )
35+ return < NewPage tutorialList = { data . tutorials } />
4036}
4137
4238export default NewPageContainer