|
| 1 | +import{Button}from'@alifd/next' |
1 | 2 | import*asReactfrom'react'
|
2 |
| -import{Button,Card}from'@alifd/next' |
3 | 3 | importCRfrom'typings'
|
4 | 4 |
|
| 5 | +importDividerfrom'../Divider' |
5 | 6 | importMarkdownfrom'../Markdown'
|
| 7 | +importLevelStageSummaryfrom'./LevelStageSummary' |
6 | 8 |
|
7 | 9 | conststyles={
|
8 |
| -card:{ |
9 |
| -// width: '20rem', |
| 10 | +card:{}, |
| 11 | +content:{ |
| 12 | +padding:'0rem 1rem', |
| 13 | +paddingBottom:'1rem', |
10 | 14 | },
|
11 |
| -disabled:{ |
12 |
| -backgroundColor:'grey', |
| 15 | +list:{ |
| 16 | +padding:'0rem', |
13 | 17 | },
|
| 18 | +options:{ |
| 19 | +padding:'0rem 1rem', |
| 20 | +}, |
| 21 | +title:{}, |
14 | 22 | }
|
15 | 23 |
|
16 | 24 | interfaceProps{
|
17 | 25 | level:CR.TutorialLevel
|
18 |
| -onNext():void |
19 |
| -onBack():void |
20 | 26 | stages:{
|
21 | 27 | [stageId:string]:any// CC.StageWithStatus
|
22 | 28 | }
|
| 29 | +onNext():void |
| 30 | +onBack():void |
23 | 31 | }
|
24 | 32 |
|
25 | 33 | constLevel=({ level, stages, onNext, onBack}:Props)=>{
|
26 | 34 | const{ title, text}=level.content
|
27 | 35 | return(
|
28 |
| -<Cardstyle={styles.card}title={title}showTitleBullet={false}contentHeight="auto"> |
29 |
| -<Markdown>{text}</Markdown> |
30 |
| -<div> |
| 36 | +<divstyle={styles.card}> |
| 37 | +<divstyle={styles.content}> |
| 38 | +<h2style={styles.title}>{title}</h2> |
| 39 | +<Markdown>{text}</Markdown> |
| 40 | +</div> |
| 41 | +<Divider/> |
| 42 | +<divstyle={styles.list}> |
31 | 43 | {level.stageList.map((stageId:string)=>{
|
32 | 44 | conststage=stages[stageId]
|
33 |
| -constunavailable=!stage.status.complete&&!stage.status.active |
34 |
| -return( |
35 |
| -<divkey={stageId}style={unavailable ?styles.disabled :{}}> |
36 |
| -<h3>{stage.content.title}</h3> |
37 |
| -<p>{stage.content.text}</p> |
38 |
| -{stage.status.active&&<ButtononClick={onNext}>Continue</Button>} |
39 |
| -{stage.status.complete&&<div>Complete</div>} |
40 |
| -</div> |
41 |
| -) |
| 45 | +return<LevelStageSummarykey={stageId}stage={stage}onNext={onNext}/> |
42 | 46 | })}
|
43 | 47 | </div>
|
44 |
| -<ButtononClick={onBack}>Back</Button> |
45 |
| -</Card> |
| 48 | +<divstyle={styles.options}> |
| 49 | +<ButtononClick={onBack}>Back</Button> |
| 50 | +</div> |
| 51 | +</div> |
46 | 52 | )
|
47 | 53 | }
|
48 | 54 |
|
|