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:
parent
af74a3ddae
commit
712996c02c
45
docs/_app.js
45
docs/_app.js
@ -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>
|
||||
)
|
||||
}
|
||||
|
@ -21,6 +21,10 @@ const Video = styled.video([], {
|
||||
})
|
||||
|
||||
export default class extends React.Component {
|
||||
static defaultProps = {
|
||||
layout: 'landing'
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user