diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-11-07 17:07:49 +0100 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-11-07 17:07:49 +0100 |
| commit | 4b9cbc645a8e6824996c4c0afef438164e569928 (patch) | |
| tree | bda7b053e7d622000a1b23ac819ef2f1c1cc4374 /src/components/experiments/ExperimentListComponent.js | |
| parent | 886877950b1a2b4006d1f5dbe93367c086e213a0 (diff) | |
| parent | 2f71cb1c9fd3e649a1f0e6f713922a73372f064e (diff) | |
Merge branch 'master' into upgrade-dependencies
# Conflicts:
# README.md
Diffstat (limited to 'src/components/experiments/ExperimentListComponent.js')
| -rw-r--r-- | src/components/experiments/ExperimentListComponent.js | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/components/experiments/ExperimentListComponent.js b/src/components/experiments/ExperimentListComponent.js index 28c06f29..2f7106e5 100644 --- a/src/components/experiments/ExperimentListComponent.js +++ b/src/components/experiments/ExperimentListComponent.js @@ -2,15 +2,30 @@ import PropTypes from "prop-types"; import React from "react"; import ExperimentRowContainer from "../../containers/experiments/ExperimentRowContainer"; -const ExperimentListComponent = ({ experimentIds }) => { +const ExperimentListComponent = ({ experimentIds, loading }) => { + let alert; + + if (loading) { + alert = ( + <div className="alert alert-success"> + <span className="fa fa-refresh fa-spin mr-2" /> + <strong>Loading Experiments...</strong> + </div> + ); + } else if (experimentIds.length === 0 && !loading) { + alert = ( + <div className="alert alert-info"> + <span className="fa fa-question-circle mr-2" /> + <strong>No experiments here yet...</strong> Add some with the button + below! + </div> + ); + } + return ( <div className="vertically-expanding-container"> - {experimentIds.length === 0 ? ( - <div className="alert alert-info"> - <span className="info-icon fa fa-question-circle mr-2" /> - <strong>No experiments here yet...</strong> Add some with the button - below! - </div> + {alert ? ( + alert ) : ( <table className="table table-striped"> <thead> @@ -37,7 +52,8 @@ const ExperimentListComponent = ({ experimentIds }) => { }; ExperimentListComponent.propTypes = { - experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired + experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired, + loading: PropTypes.bool }; export default ExperimentListComponent; |
