summaryrefslogtreecommitdiff
path: root/frontend/site/app.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
commit91e8fdb99e321496c54288fe5a3db6397c768c10 (patch)
tree2bb82323466c7895eb705138e561278b02ce8ca2 /frontend/site/app.js
parent2001ddd7e2a8926ec97fdd4d5c73b2d4e5b293de (diff)
building basic site. need to include cursors, etc
Diffstat (limited to 'frontend/site/app.js')
-rw-r--r--frontend/site/app.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/frontend/site/app.js b/frontend/site/app.js
new file mode 100644
index 0000000..cf52460
--- /dev/null
+++ b/frontend/site/app.js
@@ -0,0 +1,33 @@
+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>
+ )
+ }
+}