From c0e910669c9f9d1336d9d15ccef79390a7f76e63 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Fri, 11 Nov 2016 09:33:35 +1300 Subject: [PATCH] Italic font; Playlist actions (beta); Following playlists --- src/index.html | 2 +- src/js/components/ConfirmationButton.js | 2 + src/js/services/localstorage/middleware.js | 2 +- src/js/services/spotify/actions.js | 63 +++++++++++++++++++--- src/js/services/ui/reducer.js | 4 ++ src/js/views/Playlist.js | 58 ++++++++++++++++++-- src/scss/global/_forms.scss | 21 ++++++++ 7 files changed, 138 insertions(+), 14 deletions(-) diff --git a/src/index.html b/src/index.html index 150cbe50..896d3387 100755 --- a/src/index.html +++ b/src/index.html @@ -13,7 +13,7 @@ - + diff --git a/src/js/components/ConfirmationButton.js b/src/js/components/ConfirmationButton.js index 920de246..6ab5311d 100755 --- a/src/js/components/ConfirmationButton.js +++ b/src/js/components/ConfirmationButton.js @@ -55,6 +55,8 @@ export default class ConfirmationButton extends React.Component{ if( this.state.timing_out ) className += ' timing-out'; } + if( this.props.className ) className += ' '+this.props.className + return ( + }else{ + return + } + break + + } + } + render(){ - if( !this.props.playlist ) return null; + if( !this.props.playlist || !this.props.playlist.name ) return null; var scheme = helpers.uriSource( this.props.params.uri ); return (
+ + +
+ + { this.renderFollowOrDeleteButton() } +
+
  • { this.props.playlist.tracks_total } tracks,
  • { this.props.playlist.last_modified ?
  • Updated ago
  • : null } { scheme == 'spotify' ?
  • Spotify playlist
  • : null } { scheme == 'm3u' ?
  • Local playlist
  • : null }
+

{ this.props.playlist.name }

+ { this.props.playlist.description ?

: null }
- + { this.props.playlist.tracks ? : null } this.loadMore() }/>
@@ -89,7 +137,9 @@ class Playlist extends React.Component{ const mapStateToProps = (state, ownProps) => { return { playlist: state.ui.playlist, - mopidy_connected: state.mopidy.connected + mopidy_connected: state.mopidy.connected, + spotify_authorized: state.spotify.authorized, + spotify_userid: state.spotify.me.id } } diff --git a/src/scss/global/_forms.scss b/src/scss/global/_forms.scss index 5db4da43..99b6e581 100755 --- a/src/scss/global/_forms.scss +++ b/src/scss/global/_forms.scss @@ -13,6 +13,15 @@ input[type="date"] { font-size: 14px; } +.button-wrapper { + padding: 10px 0; + margin-top: -1px; + + &.large { + padding: 16px 0; + } +} + .button, button, input[type="button"], @@ -28,6 +37,10 @@ input[type="submit"] { background: darken( $light_grey, 6%); } + &.large { + padding: 16px 24px; + } + &.primary { background: $turquoise; color: #FFFFFF; @@ -44,6 +57,14 @@ input[type="submit"] { } } + &.tertiary { + background: $mid_grey; + color: #FFFFFF; + &:hover { + background: darken( $mid_grey, 6% ); + } + } + &.confirming, &.destructive { background: $red;