2017-03-08 09:13:24 +13:00
|
|
|
|
|
|
|
|
import React, { PropTypes } from 'react'
|
|
|
|
|
import FontAwesome from 'react-fontawesome'
|
|
|
|
|
|
|
|
|
|
import Icon from '../Icon'
|
|
|
|
|
import * as helpers from '../../helpers'
|
|
|
|
|
|
|
|
|
|
export default class AddToQueueModal extends React.Component{
|
|
|
|
|
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
uris: '',
|
2017-05-05 10:47:18 +12:00
|
|
|
next: false
|
2017-03-08 09:13:24 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleSubmit(e){
|
|
|
|
|
var uris = this.state.uris.split(',')
|
2017-05-05 10:47:18 +12:00
|
|
|
console.log(this.state)
|
|
|
|
|
this.props.mopidyActions.enqueueURIs(uris, null, this.state.next)
|
2017-03-08 09:13:24 +13:00
|
|
|
this.props.uiActions.closeModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
2017-06-21 09:16:26 +12:00
|
|
|
<h1>Add URI(s) to queue</h1>
|
2017-03-08 09:13:24 +13:00
|
|
|
|
|
|
|
|
<form onSubmit={e => this.handleSubmit(e)}>
|
|
|
|
|
<div className="field text">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2017-03-14 08:00:39 +13:00
|
|
|
placeholder="Comma-separated URIs"
|
2017-03-08 09:13:24 +13:00
|
|
|
onChange={e => this.setState({uris: e.target.value})}
|
|
|
|
|
value={this.state.uris} />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="field radio white">
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="radio"
|
2017-05-05 10:47:18 +12:00
|
|
|
name="next"
|
|
|
|
|
checked={!this.state.next}
|
|
|
|
|
onChange={e => this.setState({next: false})} />
|
2017-03-08 09:13:24 +13:00
|
|
|
<span className="label">Add to end</span>
|
|
|
|
|
</label>
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="radio"
|
2017-05-05 10:47:18 +12:00
|
|
|
name="next"
|
|
|
|
|
checked={this.state.next}
|
|
|
|
|
onChange={e => this.setState({next: true})} />
|
2017-03-08 09:13:24 +13:00
|
|
|
<span className="label">Add after current track</span>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="actions centered-text">
|
|
|
|
|
<button type="submit" className="primary wide">Add</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|