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

Commit2d9c525

Browse files
authored
Merge pull request#400 from coderoad/feature/final-page
level complete message
2 parentsc5daacf +6e96f2a commit2d9c525

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

‎web-app/src/containers/Tutorial/components/Continue.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,25 @@ const Continue = (props: Props) => {
4343
onClose()
4444
}
4545

46+
constisComplete=props.current===props.max
47+
4648
return(
4749
<>
4850
<Buttontype="primary"size="medium"onClick={onOpen}>
4951
Continue
5052
</Button>
5153
<Dialog
52-
title="Level Complete!"
54+
title={isComplete ?'Tutorial Complete!' :'Level Complete!'}
5355
visible={modalState==='open'}
5456
onClose={onClose}
5557
footer={false}
5658
css={{padding:'1rem'}}
5759
>
5860
<divcss={styles.content}>
5961
<ProgressPiecurrent={props.current}max={props.max}/>
62+
6063
<divcss={styles.message}>
61-
<h3>{props.title}</h3>
64+
<h3>{isComplete ?'Congratulations!' :props.title}</h3>
6265
<br/>
6366
<Buttontype="primary"size="large"onClick={onContinue}>
6467
Continue&nbsp;&nbsp;

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import SideBarDecorator from './utils/SideBarDecorator'
99
constcontext:Partial<T.MachineContext>={
1010
env:{machineId:'',sessionId:'',token:''},
1111
error:null,
12-
position:{levelId:'2',stepId:'2.2'},
13-
progress:{levels:{'1':true},steps:{'1.1':true,'1.2':true,'1.3':true,'2.1':true},complete:false},
1412
processes:[],
1513
testStatus:null,
1614
tutorial:{
@@ -142,12 +140,35 @@ const context: Partial<T.MachineContext> = {
142140
storiesOf('Tutorial',module)
143141
.addDecorator(SideBarDecorator)
144142
.addDecorator(withKnobs)
145-
.add('1 step',()=>{
143+
.add('1.1 Start',()=>{
146144
constfirstLevel={
147145
...context,
148146
position:{levelId:'1',stepId:'1.2'},
149147
progress:{levels:{},steps:{},complete:false},
150148
}
151149
return<Tutorialstate="Normal"context={firstLevel}send={action('send')}/>
152150
})
153-
.add('3 step',()=><Tutorialstate="Normal"context={context}send={action('send')}/>)
151+
.add('1.3 Level Complete',()=>{
152+
constlevelComplete={
153+
...context,
154+
position:{levelId:'1',stepId:'1.2'},
155+
progress:{levels:{},steps:{'1.1':true},complete:false},
156+
}
157+
return<Tutorialstate="LevelComplete"context={levelComplete}send={action('send')}/>
158+
})
159+
.add('3.1 Level Start',()=>{
160+
constnewLevel={
161+
...context,
162+
position:{levelId:'1',stepId:'1.2'},
163+
progress:{levels:{'1':true,'2':true},steps:{},complete:false},
164+
}
165+
return<Tutorialstate="Normal"context={newLevel}send={action('send')}/>
166+
})
167+
.add('3.3 Final',()=>{
168+
constlastLevel={
169+
...context,
170+
position:{levelId:'3',stepId:'3.3'},
171+
progress:{levels:{'3':true},steps:{'3.3':true},complete:true},
172+
}
173+
return<Tutorialstate="LevelComplete"context={lastLevel}send={action('send')}/>
174+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp