Clean up appearance of Rename Discussion modal

Also fix infinite loading if there's a validation error.
This commit is contained in:
Toby Zerner 2017-07-22 11:47:04 +09:30
parent fb68aa88db
commit 8da8c9ac7d

View File

@ -24,13 +24,13 @@ export default class RenameDiscussionModal extends Modal {
content() { content() {
return ( return (
<div className="Modal-body"> <div className="Modal-body">
<div className="Form"> <div className="Form Form--centered">
<div className="Form-group"> <div className="Form-group">
<input className="FormControl title" placeholder={this.currentTitle} bidi={this.newTitle} /> <input className="FormControl" bidi={this.newTitle} type="text" />
</div> </div>
<div className="Form-group"> <div className="Form-group">
{Button.component({ {Button.component({
className: 'Button Button--primary', className: 'Button Button--primary Button--block',
type: 'submit', type: 'submit',
loading: this.loading, loading: this.loading,
children: app.translator.trans('core.forum.rename_discussion.submit_button') children: app.translator.trans('core.forum.rename_discussion.submit_button')
@ -59,6 +59,9 @@ export default class RenameDiscussionModal extends Modal {
} }
m.redraw(); m.redraw();
this.hide(); this.hide();
}).catch(() => {
this.loading = false;
m.redraw();
}); });
} else { } else {
this.hide(); this.hide();