1
1
mirror of https://github.com/c8r/x0.git synced 2024-08-17 01:10:32 +03:00

Clean up docs

This commit is contained in:
Brent Jackson 2018-06-22 15:25:54 -04:00
parent af74a3ddae
commit 712996c02c
2 changed files with 11 additions and 38 deletions

View File

@ -7,7 +7,8 @@ import {
Box,
Container,
} from 'rebass'
import Layout from './_layout'
import LandingLayout from './_layout'
export default class App extends React.Component {
static defaultProps = {
@ -19,48 +20,16 @@ export default class App extends React.Component {
routes,
route,
children,
// alternative to props.children
Component,
render,
} = this.props
const { layout } = (route && route.props) || {}
// built-in layout test
if (true) {
// const logo = <div style={{ width: 32, height: 32, backgroundColor: 'tomato' }} />
return (
<ScopeProvider scope={scope}>
<SidebarLayout {...this.props} />
</ScopeProvider>
)
}
const Layout = layout === 'landing'
? LandingLayout
: SidebarLayout
return (
<ScopeProvider scope={scope}>
{false ? (
<Layout>
{children}
</Layout>
) : (
<Flex>
<Box p={2} flex='none' width={192}>
<ul>
{routes.map(route => (
<li key={route.key}>
<Link to={route.href}>
{route.name} <code>({route.dirname})</code>
</Link>
</li>
))}
</ul>
</Box>
<Box width={1} p={3}>
<Container maxWidth={768}>
{children}
</Container>
</Box>
</Flex>
)}
<Layout {...this.props} />
</ScopeProvider>
)
}

View File

@ -21,6 +21,10 @@ const Video = styled.video([], {
})
export default class extends React.Component {
static defaultProps = {
layout: 'landing'
}
render () {
return (
<React.Fragment>