mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 20:28:11 +08:00
add loading state for cells to ui
This commit is contained in:
+11
-2
@@ -4,6 +4,7 @@ import Helmet from "react-helmet";
|
|||||||
import Container from "./framework/container";
|
import Container from "./framework/container";
|
||||||
import buttonStyles from "./framework/buttons.css";
|
import buttonStyles from "./framework/buttons.css";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import PulseLoader from "halogen/PulseLoader";
|
||||||
|
|
||||||
import Categorical from "./categorical/categorical";
|
import Categorical from "./categorical/categorical";
|
||||||
import Continuous from "./continuous/continuous";
|
import Continuous from "./continuous/continuous";
|
||||||
@@ -16,7 +17,7 @@ import SectionHeader from "./framework/sectionHeader";
|
|||||||
|
|
||||||
@connect((state) => {
|
@connect((state) => {
|
||||||
return {
|
return {
|
||||||
|
cells: state.cells
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
class Home extends React.Component {
|
class Home extends React.Component {
|
||||||
@@ -71,9 +72,17 @@ class Home extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Helmet title="cellxgene" />
|
<Helmet title="cellxgene" />
|
||||||
|
{
|
||||||
|
this.props.cells.loading ?
|
||||||
|
<div style={{display: "flex", justifyContent: "center"}}>
|
||||||
|
<PulseLoader color="rgb(0,0,0)" size="10px" margin="4px"/>
|
||||||
|
<span style={{marginLeft: 10, fontFamily: globals.accentFont, fontStyle: "italic"}}>loading cells</span>
|
||||||
|
</div> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
{this.props.cells.error ? "Error loading cells" : null}
|
||||||
<SectionHeader text="Gene Selection Criteria"/>
|
<SectionHeader text="Gene Selection Criteria"/>
|
||||||
{false ? <Joy data={this.state.expressions && this.state.expressions.data}/> : ""}
|
{false ? <Joy data={this.state.expressions && this.state.expressions.data}/> : ""}
|
||||||
|
|
||||||
<Categorical/>
|
<Categorical/>
|
||||||
<Continuous/>
|
<Continuous/>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ const Cells = (state = {
|
|||||||
case "request cells success":
|
case "request cells success":
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
error: null,
|
error: null,
|
||||||
|
loading: false,
|
||||||
cells: action.data,
|
cells: action.data,
|
||||||
});
|
});
|
||||||
case "request cells error":
|
case "request cells error":
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
cells: null,
|
cells: null,
|
||||||
|
loading: false,
|
||||||
error: action.data
|
error: action.data
|
||||||
});
|
});
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user