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

Commit6e0caaa

Browse files
committed
complete new tutorial loop
1 parent3098375 commit6e0caaa

File tree

6 files changed

+35
-16
lines changed

6 files changed

+35
-16
lines changed

‎web-app/src/Routes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const Routes = () => {
7272
<StageSummaryPagesend={tempSend}context={{}asCR.MachineContext}/>
7373
</Route>
7474
<Routepath="Tutorial.Completed">
75-
<CompletedPage/>
75+
<CompletedPagesend={tempSend}context={{}asCR.MachineContext}/>
7676
</Route>
7777
</Router>
7878
</div>
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
import*asReactfrom'react'
2+
import{Button}from'@alifd/next'
3+
import*asCRfrom'typings'
24

3-
constCompletedPage=()=>{
4-
return<div>Tutorial Complete</div>
5+
conststyles={
6+
options:{
7+
padding:'0rem 1rem',
8+
},
9+
}
10+
11+
interfaceProps{
12+
context:CR.MachineContext
13+
send(action:CR.Action|string):void
14+
}
15+
16+
constCompletedPage=(props:Props)=>{
17+
constselectNewTutorial=()=>{
18+
props.send('SELECT_TUTORIAL')
19+
}
20+
return(
21+
<div>
22+
<h3>Tutorial Complete</h3>
23+
<divstyle={styles.options}>
24+
<ButtononClick={selectNewTutorial}>Continue</Button>
25+
</div>
26+
</div>
27+
)
528
}
629

730
exportdefaultCompletedPage

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{Button,Step}from'@alifd/next'
1+
import{Step}from'@alifd/next'
22
import*asReactfrom'react'
33
import*asTfrom'typings/graphql'
44

@@ -26,10 +26,9 @@ const styles = {
2626
interfaceProps{
2727
level:T.Level
2828
onNext():void
29-
onBack():void
3029
}
3130

32-
constLevel=({ level, onNext, onBack}:Props)=>{
31+
constLevel=({ level, onNext}:Props)=>{
3332
if(!level||!level.stages){
3433
thrownewError('No level stages found')
3534
}
@@ -53,7 +52,7 @@ const Level = ({ level, onNext, onBack }: Props) => {
5352
/* empty */
5453
}
5554
// note - must add click handler to title, content & step.item
56-
// as all areseparted components
55+
// as all areseparated components
5756
return(
5857
<Step.Item
5958
key={stage.id}
@@ -70,9 +69,6 @@ const Level = ({ level, onNext, onBack }: Props) => {
7069
})}
7170
</Step>
7271
</div>
73-
<divstyle={styles.options}>
74-
<ButtononClick={onBack}>Back</Button>
75-
</div>
7672
</div>
7773
)
7874
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ export const LevelSummaryPage = (props: LevelProps) => {
1313
constonNext=():void=>{
1414
props.send('NEXT')
1515
}
16-
constonBack=():void=>{
17-
props.send('BACK')
18-
}
19-
return<Levellevel={props.level}onNext={onNext}onBack={onBack}/>
16+
return<Levellevel={props.level}onNext={onNext}/>
2017
}
2118

2219
interfaceContainerProps{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as G from 'typings/graphql'
55
importStagefrom'./Stage'
66

77
interfacePageProps{
8-
context:CR.MachineContext,
8+
context:CR.MachineContext
99
send(action:CR.Action):void
1010
}
1111

‎web-app/src/services/state/machine.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
3030
},
3131
},
3232
NewTutorial:{
33+
id:'start-new-tutorial',
3334
initial:'SelectTutorial',
3435
states:{
3536
SelectTutorial:{
@@ -167,7 +168,9 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
167168
},
168169
Completed:{
169170
id:'completed-tutorial',
170-
type:'final',
171+
on:{
172+
SELECT_TUTORIAL:'#start-new-tutorial'
173+
}
171174
},
172175
},
173176
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp