1
1
mirror of https://github.com/c8r/x0.git synced 2024-08-16 08:50:29 +03:00
This commit is contained in:
Brent Jackson 2018-06-21 18:38:36 -04:00
parent 801cf519d5
commit fab43f87e6
4 changed files with 0 additions and 60 deletions

View File

@ -1,47 +0,0 @@
import React from 'react'
import { Link } from 'react-router-dom'
const routes = [
{ path: '/dynamic' },
{ path: '/dynamic/hello' },
{ path: '/dynamic/hi' },
]
export default class extends React.Component {
static defaultProps = {
ignore: true
}
static getInitialProps = async ({ path }) => {
let title = 'dynamic'
switch (path) {
case '/dynamic/hello':
title = 'hello'
break
case '/dynamic/hi':
title = 'hi'
break
}
return {
routes,
path: '/dynamic/:id*',
title,
}
}
render () {
const { match } = this.props
return <div>
<pre>dynamic routing</pre>
<Link to='/'>Home</Link>
<Link to='/dynamic'>Dynamic Routes</Link>
<Link to='/dynamic/hello'>Hello</Link>
<Link to='/dynamic/hi'>Hi</Link>
{match.params.id && (
<h1>{match.params.id}</h1>
)}
</div>
}
}

View File

@ -1,6 +0,0 @@
---
ignore: true
---
- [ ] getting-started
- [ ] getting-started

View File

@ -63,9 +63,6 @@ export default class extends React.Component {
.filter(r => r.dirname === route.dirname)
.filter(r => r !== route)
// todo: code-loader
// .map(route => route)
return (
<React.Fragment>
<Grid>

View File

@ -237,13 +237,11 @@ const MobileNav = ({
<Divider my={0} />
</MobileOnly>
// move to app
const toggle = key => state => ({ [key]: !state[key] })
const close = state => ({ menu: false })
export default class Layout extends React.Component {
static propTypes = {
// content: PropTypes.node.isRequired,
routes: PropTypes.array.isRequired
}
@ -260,8 +258,6 @@ export default class Layout extends React.Component {
location,
title = 'x0',
logo,
// theme,
// color,
} = this.props
const { menu, update } = this.state