Search display

This commit is contained in:
James Barnsley
2017-03-27 08:29:18 +13:00
parent 68f8b97a6d
commit fbc34e71a0
6 changed files with 71 additions and 36 deletions

View File

@ -8,6 +8,7 @@ import FontAwesome from 'react-fontawesome'
import Thumbnail from './Thumbnail'
import ArtistSentence from './ArtistSentence'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
class AlbumGrid extends React.Component{
@ -48,9 +49,12 @@ class AlbumGrid extends React.Component{
onClick={ (e) => this.handleClick(e,global.baseURL+'album/'+album.uri) }
onContextMenu={e => this.handleContextMenu(e,album)}>
<Thumbnail size="medium" images={album.images} />
<div className="name">{ album.name }</div>
<div className="name">
{album.name}
{this.props.show_source_icon ? <FontAwesome name={helpers.sourceIcon(album.uri)} className="source" fixedWidth /> : null}
</div>
<div className="secondary">
{ album.artists ? <ArtistSentence artists={album.artists} /> : <span>-</span> }
{album.artists ? <ArtistSentence artists={album.artists} /> : <span>-</span>}
</div>
</div>
)

View File

@ -3,9 +3,11 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { Link } from 'react-router'
import FontAwesome from 'react-fontawesome'
import Thumbnail from './Thumbnail'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
class ArtistGrid extends React.Component{
@ -41,7 +43,10 @@ class ArtistGrid extends React.Component{
key={index}
onContextMenu={e => this.handleContextMenu(e,artist)}>
<Thumbnail size="medium" images={artist.images} />
<div className="name">{ artist.name }</div>
<div className="name">
{artist.name}
{this.props.show_source_icon ? <FontAwesome name={helpers.sourceIcon(artist.uri)} className="source" fixedWidth /> : null}
</div>
<div className="secondary">
{artist.followers ? artist.followers.total.toLocaleString()+' followers' : null}
{artist.albums_uris && !artist.followers ? artist.albums_uris.length+' albums' : null}

View File

@ -7,6 +7,7 @@ import FontAwesome from 'react-fontawesome'
import Thumbnail from './Thumbnail'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
class PlaylistGrid extends React.Component{
@ -43,10 +44,13 @@ class PlaylistGrid extends React.Component{
key={index}
onContextMenu={e => this.handleContextMenu(e,playlist)}>
<Thumbnail size="medium" images={playlist.images} />
<div className="name">{ playlist.name }</div>
<div className="name">
{playlist.name}
{this.props.show_source_icon ? <FontAwesome name={helpers.sourceIcon(playlist.uri)} className="source" fixedWidth /> : null}
</div>
<div className="secondary">
{ playlist.tracks_total ? playlist.tracks_total+' tracks' : <span>0 tracks</span> }
{ playlist.can_edit ? <FontAwesome name="edit" /> : null }
{playlist.tracks_total ? playlist.tracks_total+' tracks' : <span>0 tracks</span>}
{playlist.can_edit ? <FontAwesome name="edit" /> : null}
</div>
</Link>
)