From cdf555790e622f72db4657594c5131acfdc0d4bd Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Wed, 8 Feb 2017 08:34:14 +1300 Subject: [PATCH] User view --- src/js/views/Artist.js | 3 ++- src/js/views/User.js | 24 ++++++++++-------------- src/scss/global/_forms.scss | 4 ++++ src/scss/views/_artist.scss | 15 +++++++++++++++ src/scss/views/_user.scss | 19 ++++++++++++++++--- 5 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/js/views/Artist.js b/src/js/views/Artist.js index 168b11c3..a2a6c79f 100755 --- a/src/js/views/Artist.js +++ b/src/js/views/Artist.js @@ -190,9 +190,10 @@ class Artist extends React.Component{
- +
+

{ this.props.artist.name }

{ scheme == 'spotify' ? : null } diff --git a/src/js/views/User.js b/src/js/views/User.js index 190d2500..f71e0ce5 100755 --- a/src/js/views/User.js +++ b/src/js/views/User.js @@ -36,14 +36,9 @@ class User extends React.Component{ this.props.spotifyActions.getURL( this.props.user.playlists_more, 'SPOTIFY_USER_PLAYLISTS_LOADED', this.props.params.uri ) } - renderMeFlag(){ + isMe(){ if( !this.props.spotify_authorized ) return null - - if( helpers.getFromUri('userid',this.props.params.uri) == this.props.me.id ){ - return  You - }else{ - return null - } + return helpers.getFromUri('userid',this.props.params.uri) == this.props.me.id } render(){ @@ -67,16 +62,17 @@ class User extends React.Component{
-

{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }{ this.renderMeFlag() }

- -
- -
+

{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }

    -
  • { this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0 } playlists
  • -
  • { this.props.user.followers.total.toLocaleString() } followers
  • + {this.isMe() ?
  • You
  • : null} +
  • {this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists
  • +
  • {this.props.user.followers.total.toLocaleString()} followers
+ +
+ +
diff --git a/src/scss/global/_forms.scss b/src/scss/global/_forms.scss index eb9af659..56cb056c 100755 --- a/src/scss/global/_forms.scss +++ b/src/scss/global/_forms.scss @@ -156,6 +156,10 @@ input[type="submit"] { color: $mid_grey !important; cursor: not-allowed !important; } + + &:last-of-type { + margin-right: 0; + } } .field { diff --git a/src/scss/views/_artist.scss b/src/scss/views/_artist.scss index 6cb835f7..c21988ee 100755 --- a/src/scss/views/_artist.scss +++ b/src/scss/views/_artist.scss @@ -20,6 +20,14 @@ z-index: 1; padding: 20vh 40px 0 40px; + .thumbnail { + position: relative; + z-index: 2; + float: left; + margin-right: 35px; + max-width: 144px; + } + h1 { color: #FFFFFF; padding-bottom: 20px; @@ -69,6 +77,13 @@ text-align: center; padding-left: 20px; padding-right: 20px; + padding-top: 10vh; + + .thumbnail { + float: none; + margin: 0 auto 20px; + max-width: 100px; + } .sub-views { margin-left: 0; diff --git a/src/scss/views/_user.scss b/src/scss/views/_user.scss index 6c1645d7..6850f774 100755 --- a/src/scss/views/_user.scss +++ b/src/scss/views/_user.scss @@ -12,12 +12,25 @@ h1 { padding-top: 80px; - padding-bottom: 20px; } .actions { - float: left; - margin-right: 20px; + padding-top: 20px; + } + } + + @include responsive( $bp_medium ){ + .intro { + text-align: center; + + .thumbnail { + float: none; + margin: 20px auto 20px; + } + + h1 { + padding-top: 0; + } } } }