diff --git a/src/components/library/library.css b/src/components/library/library.css
index bb5d70c67..51287daa7 100644
--- a/src/components/library/library.css
+++ b/src/components/library/library.css
@@ -12,6 +12,7 @@
overflow-y: auto;
height: auto;
padding: 0.5rem;
+ height: calc(100% - $library-header-height);
}
.library-scroll-grid.withFilterBar {
@@ -59,3 +60,11 @@
height: $library-filter-bar-height;
overflow: hidden;
}
+
+.spinner-wrapper {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
diff --git a/src/components/library/library.jsx b/src/components/library/library.jsx
index 60f65a06d..9ed7f0907 100644
--- a/src/components/library/library.jsx
+++ b/src/components/library/library.jsx
@@ -9,6 +9,7 @@ import Modal from '../../containers/modal.jsx';
import Divider from '../divider/divider.jsx';
import Filter from '../filter/filter.jsx';
import TagButton from '../../containers/tag-button.jsx';
+import Spinner from '../spinner/spinner.jsx';
import styles from './library.css';
@@ -44,9 +45,16 @@ class LibraryComponent extends React.Component {
this.state = {
selectedItem: null,
filterQuery: '',
- selectedTag: ALL_TAG.tag
+ selectedTag: ALL_TAG.tag,
+ loaded: false
};
}
+ componentDidMount () {
+ // Allow the spinner to display before loading the content
+ setTimeout(() => {
+ this.setState({loaded: true});
+ });
+ }
componentDidUpdate (prevProps, prevState) {
if (prevState.filterQuery !== this.state.filterQuery ||
prevState.selectedTag !== this.state.selectedTag) {
@@ -162,7 +170,7 @@ class LibraryComponent extends React.Component {
})}
ref={this.setFilteredDataRef}
>
- {this.getFilteredData().map((dataItem, index) => (
+ {this.state.loaded ? this.getFilteredData().map((dataItem, index) => (