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

Commitc3cf2a6

Browse files
committed
refactor out of cards
1 parentbc3df24 commitc3cf2a6

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

‎web-app/src/components/Stage/index.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1+
import{Button}from'@alifd/next'
12
import*asReactfrom'react'
2-
import{Button,Card}from'@alifd/next'
33
importCRfrom'typings'
44

55
importMarkdownfrom'../Markdown'
66
importStepfrom'../Step'
77

88
conststyles={
99
card:{
10-
// width: '20rem',
10+
padding:0,
1111
},
12+
content:{
13+
padding:'0rem 1rem',
14+
},
15+
title:{},
1216
}
1317

1418
interfaceProps{
1519
stage:CR.TutorialStage
1620
steps:{
1721
[stepId:string]:any// CC.Step
1822
}
19-
onNextStage():void
2023
complete:boolean
24+
onNextStage():void
2125
}
2226

2327
constStage=({ stage, steps, onNextStage, complete}:Props)=>{
2428
const{ title, text}=stage.content
2529
return(
26-
<Cardstyle={styles.card}title={title}showTitleBullet={false}contentHeight="auto">
27-
<Markdown>{text}</Markdown>
30+
<divstyle={styles.card}>
31+
<divstyle={styles.content}>
32+
<h2style={styles.title}>{title}</h2>
33+
<Markdown>{text}</Markdown>
34+
</div>
2835
<div>
2936
{stage.stepList.map((stepId:string)=>{
3037
conststep=steps[stepId]
@@ -36,7 +43,7 @@ const Stage = ({ stage, steps, onNextStage, complete }: Props) => {
3643
<ButtononClick={onNextStage}>Continue</Button>
3744
</div>
3845
)}
39-
</Card>
46+
</div>
4047
)
4148
}
4249

‎web-app/src/components/Step/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const styles = {
1414
gridTemplateAreas:'CheckboxMargin Content',
1515
gridTemplateColumns:'2rem 1fr',
1616
gridTemplateRows:'1fr',
17-
margin:'1rem',
17+
padding:'1rem',
1818
},
1919
left:{
2020
justifySelf:'center',

‎web-app/src/components/Summary/index.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import*asReactfrom'react'
21
import{Button,Card}from'@alifd/next'
2+
import*asReactfrom'react'
33
importCRfrom'typings'
44

55
conststyles={
66
card:{
77
// width: '20rem',
88
},
9+
content:{
10+
padding:'0rem 1rem',
11+
},
12+
options:{
13+
padding:'1rem',
14+
},
15+
title:{},
916
}
1017

1118
interfaceProps{
@@ -16,10 +23,15 @@ interface Props {
1623
constSummary=({ data, onNext}:Props)=>{
1724
const{ summary}=data
1825
return(
19-
<Cardstyle={styles.card}title={summary.title}showTitleBullet={false}contentHeight="auto">
20-
<p>{summary.description}</p>
21-
<ButtononClick={()=>onNext()}>Continue</Button>
22-
</Card>
26+
<divstyle={styles.card}>
27+
<divstyle={styles.content}>
28+
<h2style={styles.title}>{summary.title}</h2>
29+
<p>{summary.description}</p>
30+
</div>
31+
<divstyle={styles.options}>
32+
<ButtononClick={()=>onNext()}>Continue</Button>
33+
</div>
34+
</div>
2335
)
2436
}
2537

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp