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

Fixes/minor#440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 2 commits intomasterfromfixes/minor
Aug 8, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletionsweb-app/src/containers/Tutorial/components/StepProgress.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,13 +9,14 @@ const styles = {
display: 'flex' as 'flex',
justifyContent: 'flex-end' as 'flex-end',
alignItems: 'center' as 'center',
width: '10rem',
width: '150px',
color: theme['$color-white'],
marginRight: '-16px',
}),
text: (theme: Theme) => ({
color: theme['$color-white'],
marginRight: '0.5rem',
fontSize: '80%',
marginRight: '5px',
fontSize: '10px',
}),
}

Expand All@@ -28,7 +29,11 @@ const StepProgress = (props: Props) => {
const theme: Theme = useTheme()
const isWide = useMedia({ minWidth: '340px' })

const Text = `${props.current} of ${props.max}`
const Text = (
<span style={styles.text(theme)}>
{props.current} of {props.max}
</span>
)

if (isWide) {
return (
Expand Down
6 changes: 5 additions & 1 deletionweb-app/src/containers/Tutorial/formatLevels.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,6 +36,10 @@ const formatLevels = ({ position, levels, testStatus }: Input): Output => {
stepIndex = levels[levelIndex].steps.length
}

if (position.complete) {
stepIndex += 1
}

// current level
const levelUI: T.LevelUI = {
...currentLevel,
Expand All@@ -44,7 +48,7 @@ const formatLevels = ({ position, levels, testStatus }: Input): Output => {
// label step status for step component
let status: T.ProgressStatus = 'INCOMPLETE'
let subtasks
if (index < stepIndex || (index === stepIndex && position.complete)) {
if (index < stepIndex) {
status = 'COMPLETE'
} else if (index === stepIndex) {
status = 'ACTIVE'
Expand Down
4 changes: 2 additions & 2 deletionsweb-app/src/containers/Tutorial/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -181,7 +181,7 @@ const TutorialPage = (props: PageProps) => {
)}
{/* Left */}
<div css={{ flex: 1 }}>
{DISPLAY_RUN_TEST_BUTTON && level.status !== 'COMPLETE' ? (
{DISPLAY_RUN_TEST_BUTTON && level.steps.length && level.status !== 'COMPLETE' ? (
<Button
style={{ marginLeft: '1rem', width: '57px' }}
type="primary"
Expand DownExpand Up@@ -221,7 +221,7 @@ const TutorialPage = (props: PageProps) => {
/>
</div>
) : level.steps.length > 1 ? (
<StepProgress current={stepIndex + 1} max={level.steps.length} />
<StepProgress current={stepIndex} max={level.steps.length} />
) : null}
</div>
</footer>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp