From a17b76ac75f506f5da6fe8adf9c36632b60d4226 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 26 Sep 2020 14:56:02 +0200 Subject: refactor to use app-rooted js imports --- frontend/app/site/app.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 frontend/app/site/app.js (limited to 'frontend/app/site/app.js') diff --git a/frontend/app/site/app.js b/frontend/app/site/app.js new file mode 100644 index 0000000..cf52460 --- /dev/null +++ b/frontend/app/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 ( + +
+ + { + // setTimeout(() => this.props.history.push('/'), 10) + return null + }} /> +
+
+ ) + } +} -- cgit v1.2.3-70-g09d2