Button BEM; Context menu added_by

This commit is contained in:
James Barnsley
2018-12-07 15:57:20 +13:00
parent 7538402ae7
commit 078add0929
17 changed files with 145 additions and 148 deletions

View File

@ -317,7 +317,7 @@ class ContextMenu extends React.Component{
}
renderTitle(){
var context = this.getContext()
var context = this.getContext();
if (context.items_count > 1){
return (
@ -329,7 +329,7 @@ class ContextMenu extends React.Component{
)
}
if (context.items_count == 1 && context.item !== undefined){
if (context.items_count == 1 && context.name == 'queue-track' && context.item !== undefined){
if (this.props.queue_metadata["tlid_"+context.item.tlid] !== undefined){
var metadata = this.props.queue_metadata["tlid_"+context.item.tlid];

View File

@ -27,7 +27,7 @@ class FollowButton extends React.Component{
return false;
}
var className = '';
var className = 'button';
// Inherit passed-down classes
if (this.props.className){
@ -35,9 +35,9 @@ class FollowButton extends React.Component{
}
if (!this.props.lastfm_authorized){
return <button className={className+' disabled'} onClick={e => this.props.uiActions.createNotification({content: 'You must authorize LastFM first', type: 'warning'})}>{this.props.addText}</button>
return <button className={className+' button--disabled'} onClick={e => this.props.uiActions.createNotification({content: 'You must authorize LastFM first', type: 'warning'})}>{this.props.addText}</button>
} else if (this.props.is_loved && this.props.is_loved !== "0"){
return <button className={className+' destructive'} onClick={e => this.remove()}>{this.props.removeText}</button>
return <button className={className+' button--destructive'} onClick={e => this.remove()}>{this.props.removeText}</button>
} else {
return <button className={className} onClick={e => this.add()}>{this.props.addText}</button>
}

View File

@ -147,7 +147,7 @@ class Services extends React.Component{
<div className="name">Authorization</div>
<div className="input">
<SpotifyAuthenticationFrame />
{this.props.spotify.refreshing_token ? <button className="button button--working">Refreshing...</button> : <button onClick={e => this.props.spotifyActions.refreshingToken()}>Force token refresh</button>}
{this.props.spotify.refreshing_token ? <a className="button button--working">Refreshing...</a> : <a className="button" onClick={e => this.props.spotifyActions.refreshingToken()}>Force token refresh</a>}
</div>
</div>
</div>

View File

@ -386,10 +386,6 @@ export function getFeaturedPlaylists(){
))
}
// Pick the first playlist, and get the full playlist object
// We use this as in our introduction parallax panel, and need the full playlist
dispatch(getPlaylist(playlists[0].uri))
dispatch({
type: 'PLAYLISTS_LOADED',
playlists: playlists

View File

@ -52,7 +52,7 @@ class Debug extends React.Component{
render(){
var options = (
<a className="button no-hover" onClick={e => hashHistory.push(global.baseURL+'settings')}>
<a className="button button--no-hover" onClick={e => hashHistory.push(global.baseURL+'settings')}>
<Icon name="keyboard_backspace" />Back
</a>
)

View File

@ -144,17 +144,17 @@ class Queue extends React.Component{
var options = (
<span>
{this.props.spotify_enabled ? <Link className="button no-hover" to={global.baseURL+'queue/radio'}>
{this.props.spotify_enabled ? <Link className="button button--no-hover" to={global.baseURL+'queue/radio'}>
<Icon name="radio" />Radio
{this.props.radio && this.props.radio.enabled ? <span className="flag blue">On</span> : null}
</Link> : null}
<Link className="button no-hover" to={global.baseURL+'queue/history'}>
<Link className="button button--no-hover" to={global.baseURL+'queue/history'}>
<Icon name="history" />History
</Link>
<a className="button no-hover" onClick={e => {this.props.mopidyActions.clearTracklist(); this.props.uiActions.hideContextMenu();}}>
<a className="button button--no-hover" onClick={e => {this.props.mopidyActions.clearTracklist(); this.props.uiActions.hideContextMenu();}}>
<Icon name="delete_sweep" />Clear
</a>
<Link className="button no-hover" to={global.baseURL+'queue/add-uri'}>
<Link className="button button--no-hover" to={global.baseURL+'queue/add-uri'}>
<Icon name="playlist_add" />Add URI
</Link>
</span>

View File

@ -38,7 +38,7 @@ class QueueHistory extends React.Component{
render(){
var options = (
<a className="button no-hover" onClick={e => hashHistory.push(global.baseURL+'queue')}>
<a className="button button--no-hover" onClick={e => hashHistory.push(global.baseURL+'queue')}>
<Icon name="keyboard_backspace" />&nbsp;
Back
</a>

View File

@ -194,10 +194,10 @@ class Settings extends React.Component {
var options = (
<span>
<a className="button no-hover" onClick={e => hashHistory.push(global.baseURL+'settings/debug')}>
<a className="button button--no-hover" onClick={e => hashHistory.push(global.baseURL+'settings/debug')}>
<Icon name="code" />Debug
</a>
<a className="no-hover button" href="https://github.com/jaedb/Iris/wiki" target="_blank">
<a className="button button--no-hover" href="https://github.com/jaedb/Iris/wiki" target="_blank">
<Icon name="help" />Help
</a>
</span>

View File

@ -247,7 +247,7 @@ class Track extends React.Component{
</div>
<div className="actions">
<button className="primary" onClick={e => this.play()}>Play</button>
<button className="button button--primary" onClick={e => this.play()}>Play</button>
<LastfmLoveButton uri={this.props.params.uri} artist={(this.props.track.artists ? this.props.track.artists[0].name : null)} track={this.props.track.name} addText="Love" removeText="Unlove" is_loved={this.props.track.userloved} />
<ContextMenuTrigger onTrigger={e => this.handleContextMenu(e)} />
</div>

View File

@ -90,7 +90,7 @@ class DiscoverFeatured extends React.Component{
var first_playlist = playlists[0];
var options = (
<a className="button no-hover" onClick={e => {this.props.uiActions.hideContextMenu(); this.props.spotifyActions.getFeaturedPlaylists()}}>
<a className="button button--no-hover" onClick={e => {this.props.uiActions.hideContextMenu(); this.props.spotifyActions.getFeaturedPlaylists()}}>
<Icon name="refresh" />Refresh
</a>
);

View File

@ -103,7 +103,7 @@ class DiscoverNewReleases extends React.Component{
}
var options = (
<a className="button no-hover" onClick={e => {this.props.uiActions.hideContextMenu(); this.props.spotifyActions.getNewReleases()}}>
<a className="button button--no-hover" onClick={e => {this.props.uiActions.hideContextMenu(); this.props.spotifyActions.getNewReleases()}}>
<Icon name="refresh" />Refresh
</a>
);