Everything goes through Icon now

This commit is contained in:
James Barnsley
2018-05-20 20:42:20 +12:00
parent 8bdb49b3d5
commit 2e2df58100
61 changed files with 23925 additions and 25819 deletions

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import Thumbnail from './Thumbnail'
import GridItem from './GridItem'

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
import URILink from './URILink'
export default class ArtistSentence extends React.Component{

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
export default class ConfirmationButton extends React.Component{

View File

@ -2,7 +2,6 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import Icon from '../Icon';

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../../helpers'
import * as uiActions from '../../services/ui/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import ReactGA from 'react-ga'
import FontAwesome from 'react-fontawesome'
import Thumbnail from '../Thumbnail'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../../helpers'
import * as uiActions from '../../services/ui/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import ProgressSlider from './ProgressSlider'
import VolumeControl from './VolumeControl'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { hashHistory } from 'react-router'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../../helpers'
import * as uiActions from '../../services/ui/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import ReactGA from 'react-ga'
import FontAwesome from 'react-fontawesome'
import Thumbnail from '../Thumbnail'

View File

@ -2,7 +2,6 @@
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import { Router, Link, hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../helpers'
import Thumbnail from './Thumbnail'
@ -104,7 +103,7 @@ export default class GridItem extends React.Component{
{item.name ? item.name : <span className="dark-grey-text">{item.uri}</span>}
</div>
<div className="secondary">
{this.props.show_source_icon ? <FontAwesome name={helpers.sourceIcon(item.uri)} className="source" /> : null}
{this.props.show_source_icon ? <Icon name={helpers.sourceIcon(item.uri)} type="fontawesome" className="source" /> : null}
{this.renderSecondary(item)}
</div>
</div>

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { Link, hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import ArtistSentence from './ArtistSentence'
import Thumbnail from './Thumbnail'
@ -61,8 +60,8 @@ class GridSlider extends React.Component{
<div className={className}>
{ this.props.title ? this.props.title : null }
<div className="controls">
<FontAwesome name="chevron-left" disabled={this.state.page <= 0} onClick={ () => this.previous() } />
<FontAwesome name="chevron-right" disabled={this.state.page >= this._pagelimit} onClick={ () => this.next() } />
<Icon type="fontawesome" name="chevron-left" disabled={this.state.page <= 0} onClick={ () => this.previous() } />
<Icon type="fontawesome" name="chevron-right" disabled={this.state.page >= this._pagelimit} onClick={ () => this.next() } />
</div>
<div className="grid-slider">
<div className="grid artist-grid liner" style={style}>

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
import Icon from './Icon'
import ContextMenuTrigger from './ContextMenuTrigger'

View File

@ -8,6 +8,12 @@ export default class Icon extends React.Component{
super(props);
}
handleClick(e){
if (this.props.onClick){
this.props.onClick(e);
}
}
render(){
var className = "icon";
if (this.props.className){
@ -16,11 +22,11 @@ export default class Icon extends React.Component{
switch (this.props.type){
case 'fontawesome':
return <FontAwesome name={this.props.name} />;
return <FontAwesome type="fontawesome" name={this.props.name} onClick={e => this.handleClick(e)} />;
default:
className += ' material-icon';
return <i className={className}>{this.props.name}</i>;
return <i className={className} onClick={e => this.handleClick(e)}>{this.props.name}</i>;
}
}
}

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
export default class LazyLoadListener extends React.Component{

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import ArtistSentence from './ArtistSentence'
import Dater from './Dater'

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import FontAwesome from 'react-fontawesome';
import React, { PropTypes } from 'react';;
import Icon from '../Icon';
import Thumbnail from '../Thumbnail';
@ -56,7 +55,7 @@ export default class AddToPlaylistModal extends React.Component{
<Thumbnail images={playlist.images} size="small" />
<h3 className="name">{ playlist.name }</h3>
<ul className="details">
<li><FontAwesome className="source" name={helpers.sourceIcon(playlist.uri)} /></li>
<li><Icon type="fontawesome" className="source" name={helpers.sourceIcon(playlist.uri)} /></li>
<li>{ playlist.tracks_total ? <span className="grey-text">&nbsp;{ playlist.tracks_total } tracks</span> : null }</li>
</ul>
</div>

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import FontAwesome from 'react-fontawesome';
import React, { PropTypes } from 'react';;
import Icon from '../Icon';
import * as helpers from '../../helpers';

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import FontAwesome from 'react-fontawesome';
import React, { PropTypes } from 'react';;
import Icon from '../Icon';
import * as helpers from '../../helpers';

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import FontAwesome from 'react-fontawesome';
import React, { PropTypes } from 'react';;
import Icon from '../Icon';
import * as helpers from '../../helpers';
@ -168,7 +167,7 @@ export default class EditRadioModal extends React.Component{
{seed.unresolved ? <span className="grey-text">{seed.uri}</span> : <span>{seed.name}</span> }
{!seed.unresolved ? <span className="grey-text">&nbsp;({seed.type})</span> : null}
<button className="discrete remove-uri no-hover" onClick={e => this.removeSeed(seed.uri)}>
<FontAwesome name="trash" />
<Icon type="fontawesome" name="trash" />
</button>
</div>
)
@ -206,7 +205,7 @@ export default class EditRadioModal extends React.Component{
onChange={e => this.setState({uri: e.target.value, error_message: null})}
value={this.state.uri} />
<span className="button discrete add-uri no-hover" onClick={e => this.addSeed()}>
<FontAwesome name="plus" />&nbsp; Add
<Icon type="fontawesome" name="plus" />&nbsp; Add
</span>
{this.state.error_message ? <span className="description error">{this.state.error_message}</span> : null}
</div>

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
import Icon from '../Icon'
import * as helpers from '../../helpers'

View File

@ -2,7 +2,6 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../../helpers'
import Icon from '../Icon'

View File

@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import FontAwesome from 'react-fontawesome';
import React, { PropTypes } from 'react';;
import Sortable from 'react-sortablejs';
import Icon from '../Icon';
@ -65,10 +64,10 @@ export default class SearchURISchemesModal extends React.Component{
this.state.schemes.map(scheme => {
return (
<div className="list-item draggable" key={scheme} data-id={scheme}>
<FontAwesome className="grey-text drag-handle" name="bars" />
<Icon type="fontawesome" className="grey-text drag-handle" name="bars" />
{scheme.replace(':','')}
<button className="discrete remove-uri no-hover" onClick={e => this.handleToggle(scheme)}>
<FontAwesome name="trash" />
<Icon type="fontawesome" name="trash" />
</button>
</div>
)
@ -87,7 +86,7 @@ export default class SearchURISchemesModal extends React.Component{
onClick={e => this.handleToggle(scheme)}>
{scheme.replace(':','')}
&nbsp;&nbsp;
<FontAwesome name="plus" />
<Icon type="fontawesome" name="plus" />
</div>
)
})

View File

@ -1,6 +1,6 @@
import React, { PropTypes } from 'react'
import FontAwesome from 'react-fontawesome'
import React, { PropTypes } from 'react';
import Icon from './Icon';
export default class Notifications extends React.Component{
@ -26,14 +26,14 @@ export default class Notifications extends React.Component{
case 'shortcut':
return (
<div className={"notification shortcut-notification"+(notification.closing ? ' closing' : '')} key={notification.key} data-duration={notification.duration}>
<FontAwesome name={notification.content} />
<Icon type="fontawesome" name={notification.content} />
</div>
)
default:
return (
<div className={notification.type+" notification"+(notification.closing ? ' closing' : '')} key={notification.key} data-key={notification.key} data-duration={notification.duration}>
<FontAwesome name="close" className="close-button" onClick={ e => this.props.uiActions.removeNotification(notification.key, true) } />
<Icon name="close" className="close-button" onClick={ e => this.props.uiActions.removeNotification(notification.key, true) } />
{notification.title ? <h4>{notification.title}</h4> : null}
<p className="content" dangerouslySetInnerHTML={{__html: notification.content}}></p>
{notification.description ? <p className="description" dangerouslySetInnerHTML={{__html: notification.description}}></p> : null }
@ -63,7 +63,7 @@ export default class Notifications extends React.Component{
</div>
</div>
{process.message}
<FontAwesome name="close" className="close-button" onClick={e => {this.props.uiActions.cancelProcess(process.key)}} />
<Icon name="close" className="close-button" onClick={e => {this.props.uiActions.cancelProcess(process.key)}} />
</div>
)

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import { hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as pusherActions from '../services/pusher/actions'

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import Thumbnail from './Thumbnail'
import Icon from './Icon'
@ -273,7 +272,7 @@ class Services extends React.Component{
if (this.props.lastfm.session && this.props.core.users["lastfm:user:"+this.props.lastfm.session.name]){
var lastfm_icon = <Thumbnail circle={true} size="small" images={this.props.core.users["lastfm:user:"+this.props.lastfm.session.name].image} />
} else {
var lastfm_icon = <FontAwesome name="lastfm" />
var lastfm_icon = <Icon type="fontawesome" name="lastfm" />
}
return (
@ -298,7 +297,7 @@ class Services extends React.Component{
</div>
<div className="menu-item-wrapper">
<Link className={"menu-item"+(this.props.active == 'snapcast' ? ' active' : '')} to={this.props.active == 'snapcast' ? global.baseURL+'settings' : global.baseURL+'settings/service/snapcast'}>
<FontAwesome name="sliders" />
<Icon type="fontawesome" name="sliders" />
<div className="title">
Snapcast
</div>
@ -307,7 +306,7 @@ class Services extends React.Component{
</div>
<div className="menu-item-wrapper">
<Link className={"menu-item"+(this.props.active == 'icecast' ? ' active' : '')} to={this.props.active == 'icecast' ? global.baseURL+'settings' : global.baseURL+'settings/service/icecast'}>
<FontAwesome name="rss" />
<Icon type="fontawesome" name="rss" />
<div className="title">
Icecast
</div>

View File

@ -8,7 +8,6 @@ import Icon from './Icon'
import Dropzones from './Fields/Dropzones'
import Thumbnail from './Thumbnail'
import FontAwesome from 'react-fontawesome'
import * as uiActions from '../services/ui/actions'
import * as mopidyActions from '../services/mopidy/actions'
@ -102,7 +101,7 @@ class Sidebar extends React.Component{
<Dropzones />
<div className="close" onClick={e => this.props.uiActions.toggleSidebar(false)}>
<FontAwesome name="chevron-right" />
<Icon name="close" />
</div>
</aside>

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { Link, hashHistory } from 'react-router'
import FontAwesome from 'react-fontawesome'
import ArtistSentence from './ArtistSentence'
import VolumeControl from './Fields/VolumeControl'

View File

@ -2,7 +2,6 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions'
@ -84,7 +83,7 @@ class Thumbnail extends React.Component{
var zoom_icon = null;
if (this.props.canZoom){
zoom_icon = <span className="zoom" onClick={e => this.zoom(e,image)}><FontAwesome name="search" /></span>;
zoom_icon = <span className="zoom" onClick={e => this.zoom(e,image)}><Icon type="fontawesome" name="search" /></span>;
}
return (

View File

@ -2,7 +2,7 @@
import React, { PropTypes } from 'react'
import { Link } from 'react-router'
import FontAwesome from 'react-fontawesome'
import Icon from './Icon'
import ArtistSentence from './ArtistSentence'
import Dater from './Dater'
import URILink from './URILink'
@ -253,7 +253,7 @@ export default class Track extends React.Component{
)
if (this.props.show_source_icon){
track_columns.push(
<FontAwesome name={helpers.sourceIcon(track.uri)} className="source" key="source" fixedWidth />
<Icon type="fontawesome" name={helpers.sourceIcon(track.uri)} className="source" key="source" fixedWidth />
)
}
track_columns.push(
@ -287,7 +287,7 @@ export default class Track extends React.Component{
)
if (this.props.show_source_icon){
track_columns.push(
<FontAwesome name={helpers.sourceIcon(track.uri)} className="source" key="source" fixedWidth />
<Icon type="fontawesome" name={helpers.sourceIcon(track.uri)} className="source" key="source" fixedWidth />
)
}
track_columns.push(

View File

@ -2,7 +2,6 @@
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import FontAwesome from 'react-fontawesome'
import Track from './Track'
import ContextMenuTrigger from './ContextMenuTrigger'