import React, {Component} from 'react'; import './App.scss'; import Header from "./Header"; import MainPane from "../components/panels/MainPane"; import Timeline from "./Timeline"; import {BrowserRouter as Router} from "react-router-dom"; import Filters from "./Filters"; import ConfigurationPane from "../components/panels/ConfigurationPane"; import Notifications from "../components/Notifications"; import dispatcher from "../dispatcher"; class App extends Component { state = {}; componentDidMount() { dispatcher.register("notifications", payload => { if (payload.event === "connected") { this.setState({ connected: true, configured: payload.message["is_configured"] }); } }); setInterval(() => { if (document.title.endsWith("❚")) { document.title = document.title.slice(0, -1); } else { document.title += "❚"; } }, 500); } render() { let modal; if (this.state.filterWindowOpen && this.state.configured) { modal = this.setState({filterWindowOpen: false})}/>; } return (
{this.state.connected &&
this.setState({filterWindowOpen: true})}/>
{this.state.configured ? : this.setState({configured: true})}/>} {modal}
{this.state.configured && }
}
); } } export default App;