import React from "react"; import _ from "lodash"; import Helmet from "react-helmet"; import Container from "./framework/container"; import { connect } from "react-redux"; import PulseLoader from "halogen/PulseLoader"; import LeftSideBar from "./leftsidebar"; import Continuous from "./continuous/continuous"; import DynamicScatterplot from "./scatterplot/scatterplot"; import Joy from "./joy/joy"; import Graph from "./graph/graph"; import * as globals from "../globals"; import actions from "../actions"; import SectionHeader from "./framework/sectionHeader"; @connect((state) => { return { cells: state.cells } }) class App extends React.Component { constructor(props) { super(props); this.state = { }; } _onURLChanged () { this.props.dispatch({type: 'url changed', url: document.location.href}); }; componentDidMount() { /* listen for url changes, fire one when we start the app up */ window.addEventListener('popstate', this._onURLChanged); this._onURLChanged(); this.props.dispatch(actions.initialize()) /* first request includes query straight off the url bar for now */ this.props.dispatch(actions.requestCells(window.location.search)) } render() { // console.log('app:', this.props, this.state) return ( { this.props.cells.loading ?
loading cells
: null } {this.props.cells.error ? "Error loading cells" : null} {false ? : ""}
{/**/}
) } }; export default App;