Iconography for other sources

This commit is contained in:
James Barnsley
2017-08-30 20:54:54 +12:00
parent 9ba6f66566
commit 946341b367
2 changed files with 17 additions and 4 deletions

View File

@ -61,7 +61,7 @@ export default class SearchSettingsModal extends React.Component{
name="enabled"
checked={ this.state.spotify }
onChange={ e => this.setState({ spotify: !this.state.spotify })} />
<span className="label">spotify <span className="grey-text">(http)</span></span>
<span className="label">spotify &nbsp;<FontAwesome className="grey-text" name={helpers.sourceIcon('spotify')} /></span>
</label>
</div>
{
@ -74,7 +74,7 @@ export default class SearchSettingsModal extends React.Component{
name={scheme}
checked={this.state.uri_schemes.indexOf(scheme) > -1}
onChange={ e => this.handleToggle(scheme)} />
<span className="label">{scheme.replace(':','')} <span className="grey-text">(mopidy)</span></span>
<span className="label">{scheme.replace(':','')} &nbsp;<FontAwesome className="grey-text" name={helpers.sourceIcon(scheme)} /></span>
</label>
</div>
)

View File

@ -191,13 +191,26 @@ export let uriSource = function(uri){
export let sourceIcon = function(uri,source = null){
if (uri) source = uriSource(uri)
switch( source ){
case 'local':
case 'm3u':
return 'folder'
break
case 'gmusic':
return 'google'
break
case 'podcast':
case 'podcast+file':
case 'podcast+http':
case 'podcast+https':
case 'podcast+itunes':
return 'podcast'
case 'tunein':
case 'somafm':
case 'dirble':
return 'microphone'
default:
return source
}