mirror of
https://github.com/c8r/x0.git
synced 2024-10-26 15:15:04 +03:00
Clean up
This commit is contained in:
parent
801cf519d5
commit
fab43f87e6
@ -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>
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
ignore: true
|
||||
---
|
||||
|
||||
- [ ] getting-started
|
||||
- [ ] getting-started
|
@ -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>
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user