Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d4d43f

Browse files
committed
ckean up new container loading
1 parent5d38263 commit8d4d43f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as T from '../../../../typings/graphql'
44

55
importqueryTutorialsfrom'./queryTutorials'
66
import{send}from'../../utils/vscode'
7+
importLoadingPagefrom'../LoadingPage'
78
importTutorialListfrom'../../components/TutorialList'
89

910
interfaceProps{
@@ -18,18 +19,28 @@ export const NewPage = (props: Props) => (
1819
</div>
1920
)
2021

22+
constLoading=()=><LoadingPagetext="Loading tutorials"/>
23+
2124
constNewPageContainer=()=>{
2225
const{ data, loading, error}=useQuery(queryTutorials)
23-
console.log('data',data)
2426
if(loading){
25-
returnnull
27+
returnLoading
2628
}
2729

2830
if(error){
29-
return<div>{JSON.stringify(error,null,2)}</div>
31+
return(
32+
<div>
33+
<h5>{error.message}</h5>
34+
<p>{JSON.stringify(error,null,2)}</p>
35+
</div>
36+
)
3037
}
3138

32-
return<NewPageonNew={()=>send('TUTORIAL_START')}tutorialList={data.tutorials}/>
39+
return(
40+
<React.Suspensefallback={Loading}>
41+
<NewPageonNew={()=>send('TUTORIAL_START')}tutorialList={data.tutorials}/>
42+
</React.Suspense>
43+
)
3344
}
3445

3546
exportdefaultNewPageContainer

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp