diff options
| author | lens <lens@neural.garden> | 2020-12-26 20:59:17 +0000 |
|---|---|---|
| committer | lens <lens@neural.garden> | 2020-12-26 20:59:17 +0000 |
| commit | 7c15f34186622410e25ee85c01d832e48e012140 (patch) | |
| tree | e0a8dbd5e7b6a3936e7b9a666c2622ecc7ff1a65 /frontend/app/site/app.js | |
| parent | 94234db6a771f687788d3decc6dd1ba01731f7af (diff) | |
| parent | 85bfb949fea4e69dabc5b7544ce70d26d3d11393 (diff) | |
Merge branch 'master' of asdf.us:swimmer
Diffstat (limited to 'frontend/app/site/app.js')
| -rw-r--r-- | frontend/app/site/app.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/app/site/app.js b/frontend/app/site/app.js new file mode 100644 index 0000000..389e5b5 --- /dev/null +++ b/frontend/app/site/app.js @@ -0,0 +1,35 @@ +import React, { Component } from 'react' +import { ConnectedRouter } from 'connected-react-router' +import { Route } from 'react-router' + +import ViewerContainer from './viewer/viewer.container' +import actions from './actions' + +export default class App extends Component { + componentDidMount() { + const path_partz = window.location.pathname.split('/') + const graph_name = path_partz[1] + let path_name = null + if (path_partz.length > 2) { + path_name = path_partz[2] + } + // console.log('loading', graph_name, path_name) + actions.site.loadSite(graph_name, path_name) + } + + render() { + return ( + <ConnectedRouter history={this.props.history}> + <div className='app'> + <Route path={'/:graph_name/:page_name'} component={ViewerContainer} exact /> + <Route exact key='root' path='/' render={() => { + // setTimeout(() => this.props.history.push('/'), 10) + return null + }} /> + </div> + </ConnectedRouter> + ) + } +} +/* +*/ |
