mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
add why no roles and landing pages
This commit is contained in:
parent
309aee427e
commit
3d07efb5fa
24 changed files with 329 additions and 15 deletions
|
@ -1,28 +1,39 @@
|
|||
import React, { Component, Fragment } from 'react'
|
||||
import { Route } from 'react-router-dom'
|
||||
import { Route, Switch, Redirect } from 'react-router-dom'
|
||||
import { connect } from 'react-redux'
|
||||
import { withRouter } from 'react-router'
|
||||
|
||||
import Servers from '../components/servers'
|
||||
import OauthCallback from '../components/oauth-callback'
|
||||
import OauthFlow from '../components/oauth-flow'
|
||||
import Pages, { Landing } from '../pages'
|
||||
|
||||
const aaa = (props) => (<div>{ JSON.stringify(props) }</div>)
|
||||
|
||||
@withRouter
|
||||
@connect(({ appState }) => ({ ready: appState.ready }))
|
||||
@connect(({ appState, user }) => ({ ready: appState.ready, user }))
|
||||
export default class AppRouter extends Component {
|
||||
render () {
|
||||
if (!this.props.ready) {
|
||||
return null
|
||||
}
|
||||
|
||||
return <Fragment>
|
||||
<Route exact path='/' component={aaa} />
|
||||
return <Switch>
|
||||
<Route path='/s' component={Servers} />
|
||||
|
||||
<Route path='/root' component={aaa} />
|
||||
|
||||
<Route path='/oauth/callback' component={OauthCallback} />
|
||||
<Route path='/oauth/flow' component={OauthFlow} />
|
||||
</Fragment>
|
||||
<Route path="/p/landing" exact component={Landing} />
|
||||
<Route path='/p' component={Pages} />
|
||||
<Route path='/help' component={Pages} />
|
||||
|
||||
<Route exact path='/' render={() =>
|
||||
this.props.user.get('isLoggedIn')
|
||||
? <Redirect to="/s" />
|
||||
: <Landing root={true} />
|
||||
} />
|
||||
</Switch>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue