File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
web-app/src/containers/Tutorial/StagePage/Stage/StepDescription Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,24 @@ interface Props {
1818}
1919
2020const StepDescription = ( { text, mode, onLoadSolution } : Props ) => {
21+ const [ loadedSolution , setLoadedSolution ] = React . useState ( )
22+
23+ const onClickHandler = ( ) => {
24+ if ( ! loadedSolution ) {
25+ setLoadedSolution ( true )
26+ onLoadSolution ( )
27+ }
28+ }
29+
2130 if ( mode === 'INCOMPLETE' ) {
2231 return null
2332 }
33+
34+ const showLoadSolution = mode === 'ACTIVE' && ! loadedSolution
2435 return (
2536 < div style = { styles . card } >
2637 < Markdown > { text || '' } </ Markdown >
27- { mode === 'ACTIVE' && < Button onClick = { onLoadSolution } > Load Solution</ Button > }
38+ { showLoadSolution && < Button onClick = { onClickHandler } > Load Solution</ Button > }
2839 </ div >
2940 )
3041}
You can’t perform that action at this time.
0 commit comments