Skip to content

Feature/width styles #51

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
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion web-app/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import * as React from 'react'
import { Card as AlifdCard } from '@alifd/next'

const styles = {
card: {
display: 'flex',
width: '100%',
},
}

interface Props {
children: React.ReactNode
onClick?: () => void
style?: React.CSSProperties
}

const Card = (props: Props) => (
<AlifdCard showTitleBullet={false} contentHeight="auto" onClick={props.onClick} style={props.style}>
<AlifdCard
showTitleBullet={false}
contentHeight="auto"
onClick={props.onClick}
style={{ ...styles.card, ...props.style }}
>
{props.children}
</AlifdCard>
)
Expand Down
6 changes: 3 additions & 3 deletions web-app/src/components/Workspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ interface Props {
}

const resize = () => ({
width: window.innerWidth - 20,
height: window.innerHeight - 20,
minWidth: window.innerWidth - 20,
minHeight: window.innerHeight - 20,
})

const Workspace = ({ children }: Props) => {
Expand All @@ -19,7 +19,7 @@ const Workspace = ({ children }: Props) => {

const styles = {
page: {
display: 'flex' as 'flex',
display: 'flex' as 'flex',
margin: 0,
backgroundColor: 'white',
},
Expand Down
8 changes: 7 additions & 1 deletion web-app/src/containers/Continue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ import Card from '../../components/Card'
import * as CR from 'typings'
import * as G from 'typings/graphql'

const styles = {
page: {
width: '100%',
},
}

interface Props {
tutorial: G.Tutorial
onContinue(): void
onNew(): void
}

export const ContinuePage = (props: Props) => (
<div>
<div style={styles.page}>
<h3>Continue</h3>
<Card>
<div>
Expand Down
3 changes: 1 addition & 2 deletions web-app/src/containers/LoadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const styles = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: window.innerWidth - 20,
height: window.innerHeight - 20,
width: '100%',
},
}

Expand Down
5 changes: 4 additions & 1 deletion web-app/src/containers/New/NewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import * as G from 'typings/graphql'
import TutorialList from './TutorialList'

const styles = {
page: {
width: '100%',
},
header: {
height: '36px',
backgroundColor: '#EBEBEB',
Expand All @@ -22,7 +25,7 @@ interface Props {
}

const NewPage = (props: Props) => (
<div>
<div style={styles.page}>
<div style={styles.header}>
<span>CodeRoad</span>
</div>
Expand Down
23 changes: 0 additions & 23 deletions web-app/src/containers/New/TutorialItem.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion web-app/src/containers/Overview/OverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import * as G from 'typings/graphql'
import Markdown from '../../components/Markdown'

const styles = {
page: {
width: '100%',
},
summary: {
padding: '0rem 1rem 1rem 1rem',
},
Expand Down Expand Up @@ -47,7 +50,7 @@ interface Props {
}

const Summary = ({ title, description, levels, onNext }: Props) => (
<div>
<div style={styles.page}>
<div style={styles.header}>
<span>CodeRoad</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions web-app/src/containers/Tutorial/LevelPage/Level/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Markdown from '../../../../components/Markdown'
const styles = {
card: {
padding: 0,
width: '100%',
},
header: {
height: '36px',
Expand Down
3 changes: 1 addition & 2 deletions web-app/stories/utils/SideBarDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ const styles = {
container: {
position: 'relative' as 'relative',
boxSizing: 'border-box' as 'border-box',
maxWidth: '20rem',
borderRight: '2px solid black',
width: '20rem',
width: '100%',
height: window.innerHeight,
},
}
Expand Down