Skip to content

Fix/styles #387

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 2 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 29 additions & 11 deletions web-app/src/containers/Tutorial/containers/Review.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import * as T from 'typings'
import { Switch } from '@alifd/next'
import Steps from '../components/Steps'
import Content from '../components/Content'

Expand All @@ -15,7 +16,7 @@ const styles = {
header: {
display: 'flex' as 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
justifyContent: 'space-between',
height: '2rem',
backgroundColor: '#EBEBEB',
fontSize: '1rem',
Expand All @@ -25,22 +26,39 @@ const styles = {
title: {
marginLeft: '0.5rem',
},
control: {
display: 'flex' as 'flex',
alignItems: 'center',
fontSize: '70%',
},
levels: {
paddingBottom: '2rem',
},
}

const ReviewPage = (props: Props) => {
const [stepVisibility, setStepVisibility] = React.useState(false)
return (
<div css={styles.container}>
<div css={styles.header}>Review</div>
{props.levels.map((level: T.LevelUI, index: number) => (
<div key={level.id}>
<div>
<Content title={level.title} content={level.content} />
<Steps steps={level.steps} displayAll />
</div>
{/* divider */}
{index < props.levels.length - 1 ? <hr /> : null}
<div css={styles.header}>
<div>Review</div>
<div css={styles.control}>
<span>Show steps&nbsp;</span>
<Switch checked={stepVisibility} onChange={(checked) => setStepVisibility(checked)} />
</div>
))}
</div>
<div css={styles.levels}>
{props.levels.map((level: T.LevelUI, index: number) => (
<div key={level.id}>
<div>
<Content title={level.title} content={level.content} />
{stepVisibility ? <Steps steps={level.steps} displayAll /> : null}
</div>
{/* divider */}
{index < props.levels.length - 1 ? <hr /> : null}
</div>
))}
</div>
</div>
)
}
Expand Down
3 changes: 1 addition & 2 deletions web-app/src/containers/Tutorial/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react'
import * as T from 'typings'
import './style.css'
import * as selectors from '../../services/selectors'
import SideMenu from './components/SideMenu'
import Level from './components/Level'
Expand Down Expand Up @@ -118,7 +117,7 @@ const TutorialPage = (props: PageProps) => {
<div>
<div css={styles.header}>
<a onClick={() => setMenuVisible(!menuVisible)}>
<Icon type="toggle-left" size="small" />
<Icon type="toggle-left" size="small" style={{ color: '#333' }} />
</a>
<span css={styles.title}>{tutorial.summary.title}</span>
</div>
Expand Down
4 changes: 0 additions & 4 deletions web-app/src/containers/Tutorial/style.css

This file was deleted.