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

Commit6bf73c9

Browse files
committed
hide loadSolution on load
1 parent3e3a38d commit6bf73c9

File tree

1 file changed

+12
-1
lines changed
  • web-app/src/containers/Tutorial/StagePage/Stage/StepDescription

1 file changed

+12
-1
lines changed

‎web-app/src/containers/Tutorial/StagePage/Stage/StepDescription/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,24 @@ interface Props {
1818
}
1919

2020
constStepDescription=({ text, mode, onLoadSolution}:Props)=>{
21+
const[loadedSolution,setLoadedSolution]=React.useState()
22+
23+
constonClickHandler=()=>{
24+
if(!loadedSolution){
25+
setLoadedSolution(true)
26+
onLoadSolution()
27+
}
28+
}
29+
2130
if(mode==='INCOMPLETE'){
2231
returnnull
2332
}
33+
34+
constshowLoadSolution=mode==='ACTIVE'&&!loadedSolution
2435
return(
2536
<divstyle={styles.card}>
2637
<Markdown>{text||''}</Markdown>
27-
{mode==='ACTIVE'&&<ButtononClick={onLoadSolution}>Load Solution</Button>}
38+
{showLoadSolution&&<ButtononClick={onClickHandler}>Load Solution</Button>}
2839
</div>
2940
)
3041
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp