Files
Iris/src/js/components/Modal/AddToQueueModal.js

69 lines
1.7 KiB
JavaScript
Raw Normal View History

2017-03-08 09:13:24 +13:00
2018-05-20 20:42:20 +12:00
import React, { PropTypes } from 'react';;
2017-03-08 09:13:24 +13:00
2018-02-01 08:06:40 +13:00
import Icon from '../Icon';
import * as helpers from '../../helpers';
2017-03-08 09:13:24 +13:00
export default class AddToQueueModal extends React.Component{
constructor(props){
super(props)
this.state = {
uris: '',
next: false
2017-03-08 09:13:24 +13:00
}
}
handleSubmit(e){
var uris = this.state.uris.split(',');
this.props.mopidyActions.enqueueURIs(uris, null, this.state.next);
this.props.uiActions.closeModal();
2017-03-08 09:13:24 +13:00
}
render(){
return (
<div>
<h1>Add to queue</h1>
<h2 className="grey-text">Add a comma-separated list of URIs to the play queue. You must have the appropriate Mopidy backend enabled for each URI schema (eg spotify:, yt:).</h2>
2017-03-08 09:13:24 +13:00
<form onSubmit={e => this.handleSubmit(e)}>
<div className="field text">
<span className="label">URI(s)</span>
2017-03-08 09:13:24 +13:00
<input
type="text"
onChange={e => this.setState({uris: e.target.value})}
value={this.state.uris} />
</div>
<div className="field radio white">
2018-05-29 21:05:03 +12:00
<div className="label">
Position
</div>
<div className="input">
<label>
<input
type="radio"
name="next"
checked={!this.state.next}
onChange={e => this.setState({next: false})} />
<span className="label">End</span>
</label>
<label>
<input
type="radio"
name="next"
checked={this.state.next}
onChange={e => this.setState({next: true})} />
<span className="label">After current track</span>
</label>
</div>
2017-03-08 09:13:24 +13:00
</div>
<div className="actions centered-text">
2018-02-01 08:06:40 +13:00
<button type="submit" className="primary large">Add</button>
2017-03-08 09:13:24 +13:00
</div>
</form>
</div>
)
}
}