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

Commit9f45628

Browse files
committed
Reset tutorial to the Intro page
Signed-off-by: Shubham Shah <shubhamshahrising@gmail.com>
1 parent6d105c7 commit9f45628

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import React, { useState } from 'react'
33
import{Theme}from'../../../styles/theme'
44
importResetfrom'../components/Reset'
55

6+
import*asTfrom'typings'
7+
68
conststyles={
79
flexColumn:{
810
display:'flex'as'flex',
@@ -43,11 +45,21 @@ const styles = {
4345
},
4446
}
4547

46-
interfaceProps{}
48+
interfaceProps{
49+
levels:T.LevelUI[]
50+
onResetToPosition(position:T.Position):void
51+
}
4752

4853
constSettingsPage=(props:Props)=>{
4954
constonReset=()=>{
50-
console.log('Trigger a reset event here')
55+
constlevel:T.LevelUI|null=props.levels.length ?props.levels[0] :null
56+
if(level){
57+
props.onResetToPosition({
58+
levelId:level.id,
59+
stepId:null,
60+
complete:false,
61+
})
62+
}
5163
}
5264
return(
5365
<divcss={styles.container}>
@@ -61,7 +73,9 @@ const SettingsPage = (props: Props) => {
6173
<divcss={styles.menuItemHeader}>Reset Tutorial</div>
6274
<divcss={styles.menuItemContent}>
6375
This will reset the whole tutorial and change the source files back to the first level and first task
64-
checkpoint.
76+
checkpoint. This will reset the whole tutorial and change the source files back to the first level and
77+
first task checkpoint. This will reset the whole tutorial and change the source files back to the first
78+
level and first task checkpoint.
6579
</div>
6680
</div>
6781
<Resetstyle={styles.menuItemButton}warningonReset={onReset}/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const TutorialPage = (props: PageProps) => {
134134
levels:tutorial.levels,
135135
testStatus,
136136
})
137-
137+
console.log({ position})
138138
constdisableOptions=processes.length>0||props.state==='Level.TestRunning'
139139

140140
return(
@@ -156,7 +156,7 @@ const TutorialPage = (props: PageProps) => {
156156
)}
157157
{page==='review'&&<ReviewPagelevels={levels}onResetToPosition={onResetToPosition}/>}
158158

159-
{page==='settings'&&<SettingsPage/>}
159+
{page==='settings'&&<SettingsPagelevels={levels}onResetToPosition={onResetToPosition}/>}
160160
</div>
161161

162162
{props.state==='Completed' ?(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp