don't render anything until everything loads

This commit is contained in:
Colin Megill
2018-08-19 19:57:26 -04:00
parent d550b5503d
commit fddf114076
+18 -13
View File
@@ -18,7 +18,8 @@ import SectionHeader from "./framework/sectionHeader";
@connect(state => { @connect(state => {
return { return {
cells: state.cells cells: state.cells,
initialize: state.initialize
}; };
}) })
class App extends React.Component { class App extends React.Component {
@@ -60,27 +61,27 @@ class App extends React.Component {
} }
render() { render() {
// console.log('app:', this.props, this.state)
return ( return (
<Container> <Container>
<Helmet title="cellxgene" /> <Helmet title="cellxgene" />
{this.props.cells.loading ? ( {this.props.cells.loading || this.props.initialize.loading ? (
<div <div
style={{ position: "fixed", left: window.innerWidth / 2, top: 150 }} style={{
position: "fixed",
fontWeight: 500,
top: window.innerHeight / 2,
left: window.innerWidth / 2 - 50
}}
> >
{/*<PulseLoader color="rgb(0,0,0)" size="10px" margin="4px" />*/} loading cellxgene
<span
style={{ fontFamily: globals.accentFont, fontStyle: "italic" }}
>
loading cells
</span>
</div> </div>
) : null} ) : null}
{this.props.cells.error ? "Error loading cells" : null} {this.props.cells.error ? "Error loading cells" : null}
<div> <div>
<LeftSideBar /> {this.props.cells.loading || this.props.initialize.loading ? null : (
<LeftSideBar />
)}
<div <div
style={{ style={{
padding: 15, padding: 15,
@@ -88,7 +89,11 @@ class App extends React.Component {
marginLeft: 350 /* but responsive */ marginLeft: 350 /* but responsive */
}} }}
> >
<Graph /> {this.props.cells.loading ||
this.props.initialize.loading ? null : (
<Graph />
)}
<Legend /> <Legend />
{/*<Parallel/>*/} {/*<Parallel/>*/}
</div> </div>