Add support for matching from Youtube urls

This commit is contained in:
Jonathan Cremin 2015-01-12 17:38:42 +00:00
parent 7d3173c57e
commit 599e9b0850
12 changed files with 130 additions and 14 deletions

View file

@ -47,7 +47,8 @@ var SearchForm = React.createClass({
getInitialState: function () {
return {
submitting: true
submitting: true,
error: false
};
},
@ -69,7 +70,7 @@ var SearchForm = React.createClass({
submitting: false
});
if (res.body.error) {
return alert(res.body.error.message)
that.setState({error: res.body.error.message});
}
that.transitionTo("share", res.body);
});
@ -77,7 +78,8 @@ var SearchForm = React.createClass({
componentDidMount: function () {
this.setState({
submitting: false
submitting: false,
error: false
});
},
@ -90,6 +92,9 @@ var SearchForm = React.createClass({
<input type="submit" className="btn btn-lg btn-custom" value="Share Music" disabled={this.state.submitting} />
</span>
</div>
<div className={this.state.error ? "alert alert-warning" : ""} role="alert">
{this.state.error}
</div>
</form>
);
}