1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 16:05:05 +02:00
Files
php-flarum/js/forum/src/components/ChangePasswordModal.js
dcsjapan 0a66229169 Add "forum" namespacing to previously renamed core keys
- Does not affect "core.deleted_user" global string.
- Corresponding YAML will be sent later w/ more extracted strings.
2015-10-02 15:54:39 +09:00

50 lines
1.2 KiB
JavaScript

import Modal from 'flarum/components/Modal';
import Button from 'flarum/components/Button';
/**
* The `ChangePasswordModal` component shows a modal dialog which allows the
* user to send themself a password reset email.
*/
export default class ChangePasswordModal extends Modal {
className() {
return 'ChangePasswordModal Modal--small';
}
title() {
return app.trans('core.forum.change_password_title');
}
content() {
return (
<div className="Modal-body">
<div className="Form Form--centered">
<p className="helpText">{app.trans('core.forum.change_password_text')}</p>
<div className="Form-group">
{Button.component({
className: 'Button Button--primary Button--block',
type: 'submit',
loading: this.loading,
children: app.trans('core.forum.change_password_send_button')
})}
</div>
</div>
</div>
);
}
onsubmit(e) {
e.preventDefault();
this.loading = true;
app.request({
method: 'POST',
url: app.forum.attribute('apiUrl') + '/forgot',
data: {email: app.session.user.email()}
}).then(
() => this.hide(),
() => this.loading = false
);
}
}