blob: 389e5b5481551a86ecce43636b6b92d70ff3167a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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>
)
}
}
/*
*/
|