diff options
Diffstat (limited to 'frontend/site/app')
| -rw-r--r-- | frontend/site/app/index.js | 34 | ||||
| -rw-r--r-- | frontend/site/app/roadblock.js | 14 |
2 files changed, 48 insertions, 0 deletions
diff --git a/frontend/site/app/index.js b/frontend/site/app/index.js new file mode 100644 index 0000000..880c1bd --- /dev/null +++ b/frontend/site/app/index.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react' +import { ConnectedRouter } from 'connected-react-router' +import { Route } from 'react-router' + +import ViewerContainer from 'site/viewer/viewer.container' +import actions from 'site/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) + actions.site.loadSite(graph_name) + } + + render() { + return ( + <ConnectedRouter history={this.props.history}> + <div className='app'> + <Route path={'/:graph_name/:page_name'} component={ViewerContainer} exact /> + <Route path={'/:graph_name'} component={ViewerContainer} exact /> + <Route exact key='root' path='/' render={() => { + // setTimeout(() => this.props.history.push('/'), 10) + return null + }} /> + </div> + </ConnectedRouter> + ) + } +} diff --git a/frontend/site/app/roadblock.js b/frontend/site/app/roadblock.js new file mode 100644 index 0000000..c9ec0b5 --- /dev/null +++ b/frontend/site/app/roadblock.js @@ -0,0 +1,14 @@ +import React from 'react' + +import "./roadblock.css" + +export default function Roadblock ({ onClick, title }) { + return ( + <div className='roadblock' onClick={onClick}> + <div> + <h2>{title}</h2> + <button>Enter</button> + </div> + </div> + ) +}
\ No newline at end of file |
