Reorganising component folder structure
This commit is contained in:
@ -1,62 +0,0 @@
|
||||
|
||||
import React, { PropTypes } from 'react';
|
||||
import FontAwesome from 'react-fontawesome';
|
||||
|
||||
import Icon from '../Icon';
|
||||
import * as helpers from '../../helpers';
|
||||
|
||||
export default class EditSnapcastClientModal extends React.Component{
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
var client = this.props.clients[this.props.data.id];
|
||||
this.state = {
|
||||
id: client.id,
|
||||
name: client.config.name,
|
||||
latency: client.config.latency.toString()
|
||||
};
|
||||
}
|
||||
|
||||
handleSave(e){
|
||||
this.props.pusherActions.setSnapcastClientName(this.state.id, this.state.name);
|
||||
this.props.pusherActions.setSnapcastClientLatency(this.state.id, parseInt(this.state.latency));
|
||||
this.props.uiActions.closeModal();
|
||||
}
|
||||
|
||||
handleDelete(e){
|
||||
this.props.pusherActions.deleteSnapcastClient(this.state.id);
|
||||
this.props.uiActions.closeModal();
|
||||
}
|
||||
|
||||
render(){
|
||||
return (
|
||||
<div>
|
||||
<h1>Edit speaker</h1>
|
||||
<h2 className="grey-text">Description</h2>
|
||||
|
||||
<form>
|
||||
<div className="field text">
|
||||
<span className="label">Name</span>
|
||||
<input
|
||||
type="text"
|
||||
onChange={e => this.setState({name: e.target.value})}
|
||||
value={this.state.name} />
|
||||
</div>
|
||||
<div className="field text">
|
||||
<span className="label">Latency (ms)</span>
|
||||
<input
|
||||
type="number"
|
||||
onChange={e => this.setState({latency: e.target.value})}
|
||||
value={this.state.latency} />
|
||||
</div>
|
||||
</form>
|
||||
<form>
|
||||
<div className="actions centered-text">
|
||||
<button className="destructive large" onClick={e => this.handleDelete(e)}>Delete</button>
|
||||
<button className="primary large" onClick={e => this.handleSave(e)}>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,6 @@ import AddToQueueModal from './AddToQueueModal'
|
||||
import CreatePlaylistModal from './CreatePlaylistModal'
|
||||
import EditPlaylistModal from './EditPlaylistModal'
|
||||
import EditRadioModal from './EditRadioModal'
|
||||
import EditSnapcastClientModal from './EditSnapcastClientModal'
|
||||
import ImageZoomModal from './ImageZoomModal'
|
||||
import KioskModeModal from './KioskModeModal'
|
||||
import SearchURISchemesModal from './SearchURISchemesModal'
|
||||
@ -116,13 +115,6 @@ class Modal extends React.Component{
|
||||
artists={this.props.artists}
|
||||
tracks={this.props.tracks} /> : null }
|
||||
|
||||
{ this.props.modal.name == 'edit_snapcast_client' ? <EditSnapcastClientModal
|
||||
uiActions={this.props.uiActions}
|
||||
pusherActions={this.props.pusherActions}
|
||||
data={this.props.modal.data}
|
||||
clients={this.props.snapcast_clients}
|
||||
groups={this.props.snapcast_groups} /> : null }
|
||||
|
||||
{ this.props.modal.name == 'image_zoom' ? <ImageZoomModal
|
||||
uiActions={this.props.uiActions}
|
||||
data={this.props.modal.data} /> : null }
|
||||
@ -167,9 +159,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
mopidy_connected: state.mopidy.connected,
|
||||
spotify_authorized: state.spotify.authorization,
|
||||
spotify_library_playlists: state.spotify.library_playlists,
|
||||
mopidy_library_playlists: state.mopidy.library_playlists,
|
||||
snapcast_groups: state.pusher.snapcast_groups,
|
||||
snapcast_clients: state.pusher.snapcast_clients
|
||||
mopidy_library_playlists: state.mopidy.library_playlists
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user