Service worker caching, Loader component
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import Link from '../../components/Link';
|
||||
|
||||
import Loader from '../../components/Loader';
|
||||
import TrackList from '../../components/TrackList';
|
||||
import Header from '../../components/Header';
|
||||
import LazyLoadListener from '../../components/LazyLoadListener';
|
||||
@ -14,7 +14,7 @@ import * as uiActions from '../../services/ui/actions';
|
||||
import * as mopidyActions from '../../services/mopidy/actions';
|
||||
import * as spotifyActions from '../../services/spotify/actions';
|
||||
|
||||
class LibraryTracks extends React.Component {
|
||||
class LibraryTracks extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
@ -44,15 +44,13 @@ class LibraryTracks extends React.Component {
|
||||
this.props.spotifyActions.getLibraryTracksAndPlay();
|
||||
}
|
||||
|
||||
render() {
|
||||
render() {
|
||||
// Note trailing "?" makes sure our context menu in_library checks doesn't interfere
|
||||
if (helpers.isLoading(this.props.load_queue, ['spotify_me/tracks?'])) {
|
||||
return (
|
||||
<div className="view library-tracks-view">
|
||||
<Header icon="music" title="My tracks" />
|
||||
<div className="body-loader loading">
|
||||
<div className="loader" />
|
||||
</div>
|
||||
<Loader body loading />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -69,7 +67,7 @@ class LibraryTracks extends React.Component {
|
||||
|
||||
const options = (
|
||||
<a className="button button--no-hover" onClick={(e) => this.playAll(e)}>
|
||||
<Icon name="play_circle_filled" />
|
||||
<Icon name="play_circle_filled" />
|
||||
Play all
|
||||
</a>
|
||||
);
|
||||
@ -85,7 +83,7 @@ Play all
|
||||
<LazyLoadListener
|
||||
loadKey={this.props.library_tracks_more}
|
||||
showLoader={this.props.library_tracks_more}
|
||||
loadMore={() => this.loadMore()}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
@ -114,4 +112,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
spotifyActions: bindActionCreators(spotifyActions, dispatch),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(LibraryTracks);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(LibraryTracks);
|
||||
|
||||
Reference in New Issue
Block a user