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

Commitca2d77e

Browse files
committed
open continue on success
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent367da8c commitca2d77e

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

‎web-app/src/Routes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const Routes = () => {
4040
<LoadingPagetext="Loading Level..."processes={context.processes}/>
4141
</Route>
4242
<Routepaths={{Tutorial:{Level:true}}}>
43-
<TutorialPagesend={send}context={context}/>
43+
<TutorialPagesend={send}context={context}state={route.replace('Tutorial.Level.','')}/>
4444
</Route>
4545
{/* Completed */}
4646
<Routepaths={{Tutorial:{Completed:true}}}>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ interface Props {
2020
title:string
2121
current:number// level index
2222
max:number// level count
23+
defaultOpen:boolean
2324
onContinue():void
2425
}
2526

2627
constContinue=(props:Props)=>{
27-
const[modalState,setModalState]=React.useState<'closed'|'open'>('closed')
28+
const[modalState,setModalState]=React.useState<'closed'|'open'>(props.defaultOpen ?'open' :'closed')
2829

2930
constonClose=()=>{
3031
setModalState('closed')

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import TestMessage from '../../components/TestMessage'
1111
importStepProgressfrom'./components/StepProgress'
1212
import{DISPLAY_RUN_TEST_BUTTON}from'../../environment'
1313
importformatLevelsfrom'./formatLevels'
14-
// import SettingsPage from './containers/Settings'
1514
importResetfrom'./components/Reset'
1615
importContinuefrom'./components/Continue'
1716

@@ -69,6 +68,7 @@ const styles = {
6968
interfacePageProps{
7069
context:T.MachineContext
7170
send(action:T.Action):void
71+
state:string// 'Normal' | 'TestRunning' | 'TestFail' | 'TestPass' | 'LevelComplete'
7272
}
7373

7474
/**
@@ -111,6 +111,8 @@ const TutorialPage = (props: PageProps) => {
111111
testStatus,
112112
})
113113

114+
constdisableOptions=processes.length>0&&props.state==='TestRunning'
115+
114116
return(
115117
<div>
116118
<div>
@@ -141,26 +143,37 @@ const TutorialPage = (props: PageProps) => {
141143
{/* Left */}
142144
<divcss={{flex:1}}>
143145
{DISPLAY_RUN_TEST_BUTTON&&level.status!=='COMPLETE' ?(
144-
<Buttonstyle={{marginLeft:'1rem'}}type="primary"onClick={onRunTest}disabled={processes.length>0}>
146+
<Buttonstyle={{marginLeft:'1rem'}}type="primary"onClick={onRunTest}disabled={disableOptions}>
145147
Run
146148
</Button>
147149
) :null}
148150
</div>
149151

150152
{/* Center */}
151153
<divcss={{flex:1,display:'flex',justifyContent:'center'}}>
152-
<ResetonReset={onReset}disabled={processes.length>0}/>
154+
<ResetonReset={onReset}disabled={disableOptions}/>
153155
</div>
154156

155157
{/* Right */}
156158
<divcss={{flex:1,display:'flex',justifyContent:'flex-end'}}>
157-
{level.status==='COMPLETE'||!level.steps.length ?(
159+
{!level.steps.length ?(
160+
<divcss={{marginRight:'0.5rem'}}>
161+
<Continue
162+
onContinue={onContinue}
163+
current={levelIndex+1}
164+
max={levels.length}
165+
title={tutorial.summary.title}
166+
defaultOpen={false}
167+
/>
168+
</div>
169+
) :props.state==='LevelComplete' ?(
158170
<divcss={{marginRight:'0.5rem'}}>
159171
<Continue
160172
onContinue={onContinue}
161173
current={levelIndex+1}
162174
max={levels.length}
163175
title={tutorial.summary.title}
176+
defaultOpen={true}
164177
/>
165178
</div>
166179
) :level.steps.length>1 ?(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp