Kiosk mode; Placeholder for unloaded albums/artists/playlists; Gmusic integration part 1

This commit is contained in:
James Barnsley
2017-02-23 22:06:43 +13:00
parent 5aad7e0d45
commit 4bb52070f8
10 changed files with 272 additions and 92 deletions

View File

@ -0,0 +1,62 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import * as uiActions from '../../services/ui/actions'
import * as helpers from '../../helpers'
import Icon from '../Icon'
import Thumbnail from '../Thumbnail'
import ArtistSentence from '../ArtistSentence'
class KioskModeModal extends React.Component{
constructor(props){
super(props)
}
handleClick(e, connectionid){
e.preventDefault()
this.props.uiActions.closeModal()
return false;
}
render(){
if (this.props.current_track && this.props.current_track.album && this.props.current_track.album.images){
var images = this.props.current_track.album.images
} else {
var images = []
}
return (
<div className="kisk-mode-modal">
<Thumbnail className="background" images={images} />
<Thumbnail className="foreground" images={images} />
<div className="player">
<div className="current-track">
<div className="title">{ this.props.current_track ? this.props.current_track.name : <span>-</span> }</div>
{ this.props.current_track ? <ArtistSentence artists={ this.props.current_track.artists } /> : <ArtistSentence /> }
</div>
</div>
</div>
)
}
}
const mapStateToProps = (state, ownProps) => {
return {
current_track: state.ui.current_track
}
}
const mapDispatchToProps = (dispatch) => {
return {
uiActions: bindActionCreators(uiActions, dispatch)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(KioskModeModal)