Loader for Featured
This commit is contained in:
@ -8,10 +8,10 @@ import Loader from '../../components/Loader';
|
||||
import * as uiActions from '../../services/ui/actions';
|
||||
import * as mopidyActions from '../../services/mopidy/actions';
|
||||
import * as spotifyActions from '../../services/spotify/actions';
|
||||
import { isLoading } from '../../util/helpers';
|
||||
import { i18n, I18n } from '../../locale';
|
||||
import Button from '../../components/Button';
|
||||
import { indexToArray } from '../../util/arrays';
|
||||
import { makeLoadingSelector } from '../../util/selectors';
|
||||
|
||||
class DiscoverFeatured extends React.Component {
|
||||
componentDidMount() {
|
||||
@ -61,13 +61,12 @@ class DiscoverFeatured extends React.Component {
|
||||
|
||||
render = () => {
|
||||
const {
|
||||
load_queue,
|
||||
uiActions,
|
||||
loading,
|
||||
uris,
|
||||
items,
|
||||
} = this.props;
|
||||
|
||||
if (isLoading(load_queue, ['(.*)spotify_browse/featured-playlists(.*)'])) {
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="view discover-featured-view preserve-3d">
|
||||
<Header className="overlay" uiActions={uiActions}>
|
||||
@ -106,9 +105,10 @@ class DiscoverFeatured extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const loadingSelector = makeLoadingSelector(['(.*)featured-playlists(.*)']);
|
||||
const mapStateToProps = (state) => ({
|
||||
theme: state.ui.theme,
|
||||
load_queue: state.ui.load_queue,
|
||||
loading: loadingSelector(state),
|
||||
uris: state.spotify && state.spotify.featured_playlists ? state.spotify.featured_playlists.uris : null,
|
||||
items: state.core.items,
|
||||
});
|
||||
|
||||
@ -141,6 +141,7 @@ class DiscoverNewReleases extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const loadingSelector = makeLoadingSelector(['(.*)new-releases(.*)offset=0(.*)']);
|
||||
const mapStateToProps = (state) => {
|
||||
const {
|
||||
ui: {
|
||||
@ -152,7 +153,6 @@ const mapStateToProps = (state) => {
|
||||
new_releases_total: total,
|
||||
},
|
||||
} = state;
|
||||
const loadingSelector = makeLoadingSelector(['(.*)new-releases(.*)offset=0(.*)']);
|
||||
const itemSelector = makeItemSelector(uris);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user