Skip to content

Feature/styles #14

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor out of cards
  • Loading branch information
ShMcK committed Jul 14, 2019
commit c3cf2a6cf4022b6d4998df1d1d3b25baa7ccbb83
19 changes: 13 additions & 6 deletions web-app/src/components/Stage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
import { Button } from '@alifd/next'
import * as React from 'react'
import { Button, Card } from '@alifd/next'
import CR from 'typings'

import Markdown from '../Markdown'
import Step from '../Step'

const styles = {
card: {
// width: '20rem',
padding: 0,
},
content: {
padding: '0rem 1rem',
},
title: {},
}

interface Props {
stage: CR.TutorialStage
steps: {
[stepId: string]: any // CC.Step
}
onNextStage(): void
complete: boolean
onNextStage(): void
}

const Stage = ({ stage, steps, onNextStage, complete }: Props) => {
const { title, text } = stage.content
return (
<Card style={styles.card} title={title} showTitleBullet={false} contentHeight="auto">
<Markdown>{text}</Markdown>
<div style={styles.card}>
<div style={styles.content}>
<h2 style={styles.title}>{title}</h2>
<Markdown>{text}</Markdown>
</div>
<div>
{stage.stepList.map((stepId: string) => {
const step = steps[stepId]
Expand All @@ -36,7 +43,7 @@ const Stage = ({ stage, steps, onNextStage, complete }: Props) => {
<Button onClick={onNextStage}>Continue</Button>
</div>
)}
</Card>
</div>
)
}

Expand Down
2 changes: 1 addition & 1 deletion web-app/src/components/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const styles = {
gridTemplateAreas: 'CheckboxMargin Content',
gridTemplateColumns: '2rem 1fr',
gridTemplateRows: '1fr',
margin: '1rem',
padding: '1rem',
},
left: {
justifySelf: 'center',
Expand Down
22 changes: 17 additions & 5 deletions web-app/src/components/Summary/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import * as React from 'react'
import { Button, Card } from '@alifd/next'
import * as React from 'react'
import CR from 'typings'

const styles = {
card: {
// width: '20rem',
},
content: {
padding: '0rem 1rem',
},
options: {
padding: '1rem',
},
title: {},
}

interface Props {
Expand All @@ -16,10 +23,15 @@ interface Props {
const Summary = ({ data, onNext }: Props) => {
const { summary } = data
return (
<Card style={styles.card} title={summary.title} showTitleBullet={false} contentHeight="auto">
<p>{summary.description}</p>
<Button onClick={() => onNext()}>Continue</Button>
</Card>
<div style={styles.card}>
<div style={styles.content}>
<h2 style={styles.title}>{summary.title}</h2>
<p>{summary.description}</p>
</div>
<div style={styles.options}>
<Button onClick={() => onNext()}>Continue</Button>
</div>
</div>
)
}

Expand Down