-
Notifications
You must be signed in to change notification settings - Fork 555
/
Copy pathreset_password.jsx
53 lines (42 loc) · 1.19 KB
/
reset_password.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import Screen from '../../core/screen';
import ResetPasswordPane from './reset_password_pane';
import { authWithUsername, hasScreen } from './index';
import { cancelResetPassword, resetPassword } from './actions';
import { renderPasswordResetConfirmation } from './password_reset_confirmation';
import * as i18n from '../../i18n';
const Component = ({i18n, model}) => {
const headerText = i18n.html("forgotPasswordInstructions") || null;
const header = headerText && <p>{headerText}</p>;
return (
<ResetPasswordPane
emailInputPlaceholder={i18n.str("emailInputPlaceholder")}
header={header}
i18n={i18n}
lock={model}
/>
);
};
export default class ResetPassword extends Screen {
constructor() {
super("forgotPassword");
}
backHandler(m) {
return hasScreen(m, "login") ? cancelResetPassword : undefined;
}
submitButtonLabel(m) {
return i18n.str(m, ["forgotPasswordSubmitLabel"]);
}
getScreenTitle(m) {
return i18n.str(m, "forgotPasswordTitle");
}
submitHandler() {
return resetPassword;
}
renderAuxiliaryPane(m) {
return renderPasswordResetConfirmation(m);
}
render() {
return Component;
}
}