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

fix level stories#385

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 1 commit intomasterfromfix/storybook
Jul 6, 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
4 changes: 4 additions & 0 deletionstypings/tutorial.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
import { ProgressStatus } from './index'

export type Maybe<T> = T | null

export type TutorialConfig = {
Expand All@@ -19,6 +21,7 @@ export type Level = {
setup?: Maybe<StepActions>
/** A set of tasks for users linked to unit tests */
steps: Array<Step>
status?: ProgressStatus
}

/** A level task */
Expand All@@ -29,6 +32,7 @@ export type Step = {
solution: Maybe<StepActions>
hints?: string[]
subtasks?: string[]
status?: ProgressStatus
}

/** A tutorial for use in VSCode CodeRoad */
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,24 +5,24 @@ import { Menu } from '@alifd/next'
import Icon from '../../../components/Icon'

interface Props {
tutorial: TT.Tutorial
levels: TT.Level[]
position: T.Position
progress: T.Progress
setTitle: (title: string) => void
setContent: (content: string) => void
}

const ContentMenu = ({tutorial, position, progress, setTitle, setContent }: Props) => {
const ContentMenu = ({levels, position, progress, setTitle, setContent }: Props) => {
const setMenuContent = (levelId: string) => {
const selectedLevel: TT.Level | undefined =tutorial.levels.find((l: TT.Level) => l.id === levelId)
const selectedLevel: TT.Level | undefined = levels.find((l: TT.Level) => l.id === levelId)
if (selectedLevel) {
setTitle(selectedLevel.title)
setContent(selectedLevel.content)
}
}
return (
<Menu>
{tutorial.levels.map((level: TT.Level) => {
{levels.map((level: TT.Level) => {
const isCurrent = level.id === position.levelId
const isComplete = progress.levels[level.id]
let icon
Expand Down
8 changes: 5 additions & 3 deletionsweb-app/src/containers/Tutorial/components/Level.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ const styles = {
}

interface Props {
tutorial: TT.Tutorial
tutorial:Exclude<TT.Tutorial, 'config'>
index: number
status: 'COMPLETE' | 'ACTIVE' | 'INCOMPLETE'
progress: T.Progress
Expand All@@ -114,7 +114,9 @@ const Level = ({
processes,
testStatus,
}: Props) => {
const level = tutorial.levels[index]
const level: TT.Level = tutorial.levels[index]

console.log(level)

const [title, setTitle] = React.useState<string>(level.title)
const [content, setContent] = React.useState<string>(level.content)
Expand All@@ -135,7 +137,7 @@ const Level = ({

const menu = (
<ContentMenu
tutorial={tutorial}
levels={tutorial.levels || []}
position={position}
progress={progress}
setTitle={setTitle}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp