1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 10:55:47 +02:00

update: ForgotPasswordModal

This commit is contained in:
Alexander Skvortsov
2020-08-07 15:59:29 -04:00
committed by Franz Liedke
parent 99d79e7571
commit 5faab8bdbd

View File

@@ -1,5 +1,5 @@
import Stream from 'mithril-stream';
import Modal from '../../common/components/Modal';
import Alert from '../../common/components/Alert';
import Button from '../../common/components/Button';
import extractText from '../../common/utils/extractText';
@@ -12,15 +12,13 @@ import extractText from '../../common/utils/extractText';
* - `email`
*/
export default class ForgotPasswordModal extends Modal {
init() {
super.init();
oninit(attrs) {
/**
* The value of the email input.
*
* @type {Function}
*/
this.email = m.prop(this.props.email || '');
this.email = Stream(attrs.email || '');
/**
* Whether or not the password reset email was sent successfully.
@@ -65,17 +63,19 @@ export default class ForgotPasswordModal extends Modal {
type="email"
placeholder={extractText(app.translator.trans('core.forum.forgot_password.email_placeholder'))}
value={this.email()}
onchange={m.withAttr('value', this.email)}
bidi={this.email}
disabled={this.loading}
/>
</div>
<div className="Form-group">
{Button.component({
{Button.component(
{
className: 'Button Button--primary Button--block',
type: 'submit',
loading: this.loading,
children: app.translator.trans('core.forum.forgot_password.submit_button'),
})}
},
app.translator.trans('core.forum.forgot_password.submit_button')
)}
</div>
</div>
</div>