@@ -11,7 +11,6 @@ import TestMessage from '../../components/TestMessage'
1111import StepProgress from './components/StepProgress'
1212import { DISPLAY_RUN_TEST_BUTTON } from '../../environment'
1313import formatLevels from './formatLevels'
14- // import SettingsPage from './containers/Settings'
1514import Reset from './components/Reset'
1615import Continue from './components/Continue'
1716
@@ -69,6 +68,7 @@ const styles = {
6968interface PageProps {
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+ const disableOptions = processes . length > 0 && props . state === 'TestRunning'
115+
114116 return (
115117 < div >
116118 < div >
@@ -141,26 +143,37 @@ const TutorialPage = (props: PageProps) => {
141143 { /* Left */ }
142144 < div css = { { flex : 1 } } >
143145 { DISPLAY_RUN_TEST_BUTTON && level . status !== 'COMPLETE' ? (
144- < Button style = { { marginLeft : '1rem' } } type = "primary" onClick = { onRunTest } disabled = { processes . length > 0 } >
146+ < Button style = { { marginLeft : '1rem' } } type = "primary" onClick = { onRunTest } disabled = { disableOptions } >
145147 Run
146148 </ Button >
147149 ) : null }
148150 </ div >
149151
150152 { /* Center */ }
151153 < div css = { { flex : 1 , display : 'flex' , justifyContent : 'center' } } >
152- < Reset onReset = { onReset } disabled = { processes . length > 0 } />
154+ < Reset onReset = { onReset } disabled = { disableOptions } />
153155 </ div >
154156
155157 { /* Right */ }
156158 < div css = { { flex : 1 , display : 'flex' , justifyContent : 'flex-end' } } >
157- { level . status === 'COMPLETE' || ! level . steps . length ? (
159+ { ! level . steps . length ? (
160+ < div css = { { 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 < div css = { { 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