Overhaul of user template (more like Artist); Search responsive

This commit is contained in:
James Barnsley
2017-06-23 08:57:26 +12:00
parent 278d6f73be
commit ff20a23d9a
9 changed files with 121 additions and 57 deletions

View File

@ -8,7 +8,8 @@ import Thumbnail from '../components/Thumbnail'
import PlaylistGrid from '../components/PlaylistGrid' import PlaylistGrid from '../components/PlaylistGrid'
import FollowButton from '../components/FollowButton' import FollowButton from '../components/FollowButton'
import LazyLoadListener from '../components/LazyLoadListener' import LazyLoadListener from '../components/LazyLoadListener'
import Header from '../components/Header' import SidebarToggleButton from '../components/SidebarToggleButton'
import Parallax from '../components/Parallax'
import ContextMenuTrigger from '../components/ContextMenuTrigger' import ContextMenuTrigger from '../components/ContextMenuTrigger'
import * as helpers from '../helpers' import * as helpers from '../helpers'
@ -54,35 +55,41 @@ class User extends React.Component{
} }
} }
if (this.props.user && this.props.user.images ){
var image = helpers.sizedImages(this.props.user.images).huge
} else {
var image = null
}
return ( return (
<div className="view user-view"> <div className="view user-view">
<Header icon="play" title="User" /> <SidebarToggleButton />
<div className="content-wrapper">
<div className="intro"> <div className="intro">
<Thumbnail circle={true} size="medium" images={ this.props.user.images } /> <Parallax image={image} />
<div className="liner">
<Thumbnail image={image} canZoom circle />
<h1>{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }</h1> <h1>{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }</h1>
<h2>
<ul className="details"> <ul className="details">
{this.isMe() ? <li>You</li> : null}
<li>{this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists</li> <li>{this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists</li>
<li>{this.props.user.followers.total.toLocaleString()} followers</li> <li>{this.props.user.followers.total.toLocaleString()} followers</li>
{this.isMe() ? <li>You</li> : null}
</ul> </ul>
</h2>
<div className="actions"> <div className="actions">
<FollowButton className="secondary" uri={this.props.params.uri} addText="Follow" removeText="Unfollow" /> <FollowButton className="secondary" uri={this.props.params.uri} addText="Follow" removeText="Unfollow" />
</div> </div>
</div> </div>
<div className="main"> </div>
<div className="content-wrapper">
<section className="grid-wrapper"> <section className="grid-wrapper">
<h4>Playlists</h4>
<PlaylistGrid playlists={playlists} /> <PlaylistGrid playlists={playlists} />
<LazyLoadListener enabled={this.props.user.playlists_more} loadMore={ () => this.loadMore() }/> <LazyLoadListener enabled={this.props.user.playlists_more} loadMore={ () => this.loadMore() }/>
</section> </section>
</div>
</div> </div>
</div> </div>
) )
@ -90,7 +97,6 @@ class User extends React.Component{
return ( return (
<div className="view user-view"> <div className="view user-view">
<Header icon="play" title="User" />
<div className="intro"> <div className="intro">
<Thumbnail circle size="medium" images={[]} /> <Thumbnail circle size="medium" images={[]} />
<h1><span className="placeholder"></span></h1> <h1><span className="placeholder"></span></h1>

View File

@ -68,13 +68,17 @@ main {
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
padding: 10px 10px 10px 0; padding: 10px 10px 10px 0;
.icon { .icon {
visibility: hidden; visibility: hidden;
} }
h1 {
vertical-align: top;
padding-top: 8px;
}
.options { .options {
top: 10px; top: 10px;
right: 0; right: 0;

View File

@ -335,10 +335,12 @@ footer {
h1 { h1 {
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1.8rem;
} }
h2 { h2 {
font-size: 1.2rem; font-size: 1.2rem;
line-height: 1.3rem;
} }
h3 { h3 {

View File

@ -166,12 +166,12 @@ input[type="submit"] {
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
min-width: 120px;
margin-right: 10px; margin-right: 10px;
} }
@include responsive( $bp_narrow ){ @include responsive( $bp_narrow ){
min-width: 0; padding-left: 20px;
padding-right: 20px;
} }
} }

View File

@ -33,23 +33,32 @@ main .album-view {
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
.title { padding-top: 0;
padding: 0 20px 20px; padding-left: 10px;
}
.thumbnail-wrapper {
width: 40%;
padding: 10px 20px 10px 10px;
.thumbnail { .thumbnail {
float: none; float: none;
max-width: none; max-width: none;
margin: 0 0 0 0; margin: 0 0 0 0;
}
}
.image { .title {
padding-bottom: 70%; padding: 20px 20px 20px 40%;
min-height: 30vw;
.details {
padding: 5px 0;
} }
} }
.actions { .actions {
text-align: center; text-align: center;
padding-bottom: 20px; padding: 20px 5px;
} }
} }
} }

View File

@ -32,7 +32,7 @@
} }
h1 { h1 {
color: #FFFFFF; color: $white;
padding-bottom: 25px; padding-bottom: 25px;
} }

View File

@ -33,23 +33,32 @@ main .playlist-view {
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
.title { padding-top: 0;
padding: 20px 20px; padding-left: 10px;
}
.thumbnail-wrapper {
width: 40%;
padding: 10px 20px 10px 10px;
.thumbnail { .thumbnail {
float: none; float: none;
max-width: none; max-width: none;
margin: 0 0 0 0; margin: 0 0 0 0;
}
}
.image { .title {
padding-bottom: 70%; padding: 20px 20px 20px 40%;
min-height: 30vw;
.details {
padding: 5px 0;
} }
} }
.actions { .actions {
text-align: center; text-align: center;
padding-bottom: 20px; padding: 20px 5px;
} }
} }
} }

View File

@ -9,6 +9,7 @@
input { input {
@include feature_font(); @include feature_font();
padding: 0; padding: 0;
width: 100%;
font-size: 3rem; font-size: 3rem;
font-weight: 700; font-weight: 700;
height: 3rem; height: 3rem;
@ -30,6 +31,17 @@
} }
@include responsive( $bp_medium ){ @include responsive( $bp_medium ){
.search-form {
top: 18px;
left: 50px;
input {
font-size: 1.8rem;
height: 1.8rem;
}
}
.search-result-sections { .search-result-sections {
padding: 10px 10px 0; padding: 10px 10px 0;

View File

@ -2,20 +2,42 @@
.user-view { .user-view {
.intro { .intro {
@include clearfix(); @include clearfix();
padding-bottom: 20px; position: relative;
.parallax {
position: absolute;
z-index: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: auto;
}
.liner {
position: relative;
z-index: 1;
padding: 30vh 40px 40px 260px;
.thumbnail { .thumbnail {
max-width: 200px; position: absolute;
margin: 40px 40px 0 40px; z-index: 2;
float: left; left: 40px;
bottom: 20px;
max-width: 184px;
.image {
background-color: $darkest_grey;
}
} }
h1 { h1 {
padding-top: 80px; color: $white;
} }
.actions { h2 {
padding-top: 20px; padding-bottom: 25px;
}
} }
} }
@ -25,7 +47,7 @@
.thumbnail { .thumbnail {
float: none; float: none;
margin: 20px auto 20px; margin: 0 auto 20px;
} }
h1 { h1 {