@@ -2,13 +2,10 @@ import * as React from 'react'
2
2
import * as T from 'typings'
3
3
import * as TT from 'typings/tutorial'
4
4
import { css, jsx } from '@emotion/core'
5
- import { Dropdown } from '@alifd/next'
6
- import Icon from '../../../components/Icon'
7
5
import Button from '../../../components/Button'
8
6
import Markdown from '../../../components/Markdown'
9
7
import ProcessMessages from '../../../components/ProcessMessages'
10
8
import TestMessage from '../../../components/TestMessage'
11
- import ContentMenu from './ContentMenu'
12
9
import Step from './Step'
13
10
import { DISPLAY_RUN_TEST_BUTTON } from '../../../environment'
14
11
@@ -25,20 +22,7 @@ const styles = {
25
22
padding: 0,
26
23
paddingBottom: '5rem',
27
24
},
28
- header: {
29
- display: 'flex' as 'flex',
30
- alignItems: 'center',
31
- justifyContent: 'space-between',
32
- height: '2rem',
33
- backgroundColor: '#EBEBEB',
34
- fontSize: '1rem',
35
- lineHeight: '1rem',
36
- padding: '10px 1rem',
37
- },
38
- learn: {
39
- textDecoration: 'none',
40
- color: 'inherit',
41
- },
25
+
42
26
text: {
43
27
padding: '0rem 1rem',
44
28
paddingBottom: '1rem',
@@ -122,9 +106,6 @@ const Level = ({
122
106
}: Props) => {
123
107
const level: TT.Level = tutorial.levels[index]
124
108
125
- const [title, setTitle] = React.useState<string>(level.title)
126
- const [content, setContent] = React.useState<string>(level.content)
127
-
128
109
// hold state for hints for the level
129
110
const [displayHintsIndex, setDisplayHintsIndex] = React.useState<number[]>([])
130
111
const setHintsIndex = (index: number, value: number) => {
@@ -139,16 +120,6 @@ const Level = ({
139
120
setDisplayHintsIndex(steps.map((s) => -1))
140
121
}, [position.levelId])
141
122
142
- const menu = (
143
- <ContentMenu
144
- levels={tutorial.levels || []}
145
- position={position}
146
- progress={progress}
147
- setTitle={setTitle}
148
- setContent={setContent}
149
- />
150
- )
151
-
152
123
const steps: Array<TT.Step & { status: T.ProgressStatus }> = level.steps.map((step: TT.Step) => {
153
124
// label step status for step component
154
125
let status: T.ProgressStatus = 'INCOMPLETE'
@@ -175,27 +146,15 @@ const Level = ({
175
146
176
147
return (
177
148
<div css={styles.page}>
178
- <div css={styles.header}>
179
- <Dropdown
180
- trigger={
181
- <a css={styles.learn}>
182
- {tutorial.summary.title} <Icon type="arrow-down" size="xxs" />
183
- </a>
184
- }
185
- triggerType="click"
186
- >
187
- {menu}
188
- </Dropdown>
189
- </div>
190
149
<div css={styles.content}>
191
- {content.length ? (
150
+ {level. content.length ? (
192
151
<div css={styles.text}>
193
- <h2 css={styles.title}>{title}</h2>
194
- <Markdown>{content || ''}</Markdown>
152
+ <h2 css={styles.title}>{level. title}</h2>
153
+ <Markdown>{level. content || ''}</Markdown>
195
154
</div>
196
155
) : null}
197
156
198
- {content.length && steps.length ? <div css={styles.separator} /> : null}
157
+ {level. content.length && steps.length ? <div css={styles.separator} /> : null}
199
158
200
159
{steps.length ? (
201
160
<div css={styles.tasks}>
@@ -249,12 +208,7 @@ const Level = ({
249
208
<Button type="primary" onClick={onRunTest} disabled={processes.length > 0}>
250
209
Run
251
210
</Button>
252
- ) : (
253
- <span>
254
- {typeof index === 'number' ? `${index + 1}. ` : ''}
255
- {title}
256
- </span>
257
- )}
211
+ ) : null}
258
212
<span>
259
213
{status === 'COMPLETE' || !steps.length ? (
260
214
<Button type="primary" onClick={onContinue}>
0 commit comments