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

Commit93b5e78

Browse files
committed
fix step progress bar
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent7497a0f commit93b5e78

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ const styles = {
99
display:'flex'as'flex',
1010
justifyContent:'flex-end'as'flex-end',
1111
alignItems:'center'as'center',
12-
width:'10rem',
12+
width:'150px',
1313
color:theme['$color-white'],
14+
marginRight:'-16px',
1415
}),
1516
text:(theme:Theme)=>({
1617
color:theme['$color-white'],
17-
marginRight:'0.5rem',
18-
fontSize:'80%',
18+
marginRight:'5px',
19+
fontSize:'10px',
1920
}),
2021
}
2122

@@ -28,7 +29,11 @@ const StepProgress = (props: Props) => {
2829
consttheme:Theme=useTheme()
2930
constisWide=useMedia({minWidth:'340px'})
3031

31-
constText=`${props.current} of${props.max}`
32+
constText=(
33+
<spanstyle={styles.text(theme)}>
34+
{props.current} of{props.max}
35+
</span>
36+
)
3237

3338
if(isWide){
3439
return(

‎web-app/src/containers/Tutorial/formatLevels.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const formatLevels = ({ position, levels, testStatus }: Input): Output => {
3636
stepIndex=levels[levelIndex].steps.length
3737
}
3838

39+
if(position.complete){
40+
stepIndex+=1
41+
}
42+
3943
// current level
4044
constlevelUI:T.LevelUI={
4145
...currentLevel,
@@ -44,7 +48,7 @@ const formatLevels = ({ position, levels, testStatus }: Input): Output => {
4448
// label step status for step component
4549
letstatus:T.ProgressStatus='INCOMPLETE'
4650
letsubtasks
47-
if(index<stepIndex||(index===stepIndex&&position.complete)){
51+
if(index<stepIndex){
4852
status='COMPLETE'
4953
}elseif(index===stepIndex){
5054
status='ACTIVE'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const TutorialPage = (props: PageProps) => {
221221
/>
222222
</div>
223223
) :level.steps.length>1 ?(
224-
<StepProgresscurrent={stepIndex+1}max={level.steps.length}/>
224+
<StepProgresscurrent={stepIndex}max={level.steps.length}/>
225225
) :null}
226226
</div>
227227
</footer>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp