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

Commitc69b868

Browse files
committed
working stage container
1 parent7bab14b commitc69b868

File tree

7 files changed

+22
-23
lines changed

7 files changed

+22
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
import*asReactfrom'react'
22
import{useQuery}from'@apollo/react-hooks'
3-
import*asTfrom'typings/graphql'
43

54
importStagefrom'components/Stage'
65
importErrorViewfrom'components/Error'
76
importqueryStagefrom'./queryStage'
87

98
interfacePageProps{
10-
stage:T.Stage
119
send(action:string):void
1210
}
1311

14-
exportconstStageSummaryPage=({ stage, send}:PageProps)=>{
15-
if(!stage){
16-
// may throw if no stage is supplied on restart
17-
thrownewError('No stage provided')
18-
}
19-
20-
conststageComplete=stage.status==='COMPLETE'
21-
22-
constonContinue=():void=>{
23-
send('STAGE_NEXT')
24-
}
25-
26-
return<Stagestage={stage}onContinue={onContinue}complete={stageComplete}/>
27-
}
28-
29-
constStageSummaryPageContainer=props=>{
12+
constStageSummaryPageContainer=(props:PageProps)=>{
3013
const{ loading, error, data}=useQuery(queryStage,{
3114
variables:{
3215
tutorialId:'1',
33-
version:'1.0.0',
16+
version:'0.1.0',
3417
stageId:'1',
3518
},
3619
})
@@ -42,9 +25,15 @@ const StageSummaryPageContainer = props => {
4225
return<ErrorViewerror={error}/>
4326
}
4427

28+
console.log('data',data)
29+
4530
const{ stage}=data.tutorial.version
4631

47-
return<StageSummaryPagestage={stage}send={props.send}/>
32+
constonContinue=():void=>{
33+
props.send('STAGE_NEXT')
34+
}
35+
36+
return<Stagestage={stage}onContinue={onContinue}/>
4837
}
4938

5039
exportdefaultStageSummaryPageContainer

‎web-app/src/containers/Tutorial/StageSummaryPage/queryStage.tsrenamed to‎web-app/src/containers/Tutorial/StagePage/queryStage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export default gql`
1212
title
1313
text
1414
status @client
15+
steps {
16+
id
17+
title
18+
text
19+
status @client
20+
}
1521
}
1622
}
1723
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { send } from 'utils/vscode'
44
importRouterfrom'components/Router'
55
importLoadingPagefrom'../LoadingPage'
66
importSummaryPagefrom'./SummaryPage'
7-
importLevelSummaryPagefrom'./LevelSummaryPage'
8-
importStageSummaryPagefrom'./StageSummaryPage'
7+
importLevelSummaryPagefrom'./LevelPage'
8+
importStageSummaryPagefrom'./StagePage'
99
importCompletedPagefrom'./CompletedPage'
1010

1111
const{ Route}=Router

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import SideBarDecorator from './utils/SideBarDecorator'
88

99
importapolloProviderfrom'./utils/ApolloDecorator'
1010
importLevelfrom'../src/components/Level'
11-
importLevelSummaryPageContainer,{LevelSummaryPage}from'../src/containers/Tutorial/LevelSummaryPage'
11+
importLevelSummaryPageContainer,{LevelSummaryPage}from'../src/containers/Tutorial/LevelPage'
1212

1313
storiesOf('Tutorial SideBar',module)
1414
.addDecorator(SideBarDecorator)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { storiesOf } from '@storybook/react'
66
importSideBarDecoratorfrom'./utils/SideBarDecorator'
77

88
importStagefrom'../src/components/Stage'
9+
importStageContainerfrom'../src/containers/Tutorial/StagePage'
10+
importApolloDecoratorfrom'./utils/ApolloDecorator'
911

1012
storiesOf('Tutorial SideBar',module)
1113
.addDecorator(SideBarDecorator)
@@ -47,3 +49,5 @@ storiesOf('Tutorial SideBar', module)
4749
onContinue={action('onContinue')}
4850
/>
4951
))
52+
.addDecorator(ApolloDecorator)
53+
.add('Stage Summary Container',()=><StageContainersend={action('send')}/>)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp