We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent3098375 commit6e0caaaCopy full SHA for 6e0caaa
web-app/src/Routes.tsx
@@ -72,7 +72,7 @@ const Routes = () => {
72
<StageSummaryPagesend={tempSend}context={{}asCR.MachineContext}/>
73
</Route>
74
<Routepath="Tutorial.Completed">
75
-<CompletedPage/>
+<CompletedPagesend={tempSend}context={{}asCR.MachineContext}/>
76
77
</Router>
78
</div>
web-app/src/containers/Tutorial/CompletedPage.tsx
@@ -1,7 +1,30 @@
1
import*asReactfrom'react'
2
+import{Button}from'@alifd/next'
3
+import*asCRfrom'typings'
4
-constCompletedPage=()=>{
-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
27
+)
28
}
29
30
exportdefaultCompletedPage
web-app/src/containers/Tutorial/LevelPage/Level/index.tsx
@@ -1,4 +1,4 @@
-import{Button,Step}from'@alifd/next'
+import{Step}from'@alifd/next'
import*asTfrom'typings/graphql'
@@ -26,10 +26,9 @@ const styles = {
interfaceProps{
level:T.Level
onNext():void
-onBack():void
31
32
-constLevel=({ level, onNext, onBack}:Props)=>{
+constLevel=({ level, onNext}:Props)=>{
33
if(!level||!level.stages){
34
thrownewError('No level stages found')
35
@@ -53,7 +52,7 @@ const Level = ({ level, onNext, onBack }: Props) => {
53
52
/* empty */
54
55
// note - must add click handler to title, content & step.item
56
-// as all areseparted components
+// as all areseparated components
57
return(
58
<Step.Item
59
key={stage.id}
@@ -70,9 +69,6 @@ const Level = ({ level, onNext, onBack }: Props) => {
70
69
})}
71
</Step>
-<divstyle={styles.options}>
-<ButtononClick={onBack}>Back</Button>
-</div>
)
web-app/src/containers/Tutorial/LevelPage/index.tsx
@@ -13,10 +13,7 @@ export const LevelSummaryPage = (props: LevelProps) => {
constonNext=():void=>{
props.send('NEXT')
-constonBack=():void=>{
-props.send('BACK')
-}
-return<Levellevel={props.level}onNext={onNext}onBack={onBack}/>
+return<Levellevel={props.level}onNext={onNext}/>
interfaceContainerProps{
web-app/src/containers/Tutorial/StagePage/index.tsx
@@ -5,7 +5,7 @@ import * as G from 'typings/graphql'
importStagefrom'./Stage'
interfacePageProps{
-context:CR.MachineContext,
send(action:CR.Action):void
web-app/src/services/state/machine.ts
@@ -30,6 +30,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
},
NewTutorial:{
+id:'start-new-tutorial',
initial:'SelectTutorial',
states:{
36
SelectTutorial:{
@@ -167,7 +168,9 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
167
168
169
Completed:{
170
id:'completed-tutorial',
-type:'final',
171
+on:{
172
+SELECT_TUTORIAL:'#start-new-tutorial'
173
174
175
176