Cleanup part I
parent
393337e1c9
commit
9da7881c5c
|
@ -19,21 +19,13 @@ interface PasswordForm {
|
|||
password: string;
|
||||
}
|
||||
|
||||
interface ChangePWState {
|
||||
status: SpecialStatus;
|
||||
form: PasswordForm
|
||||
}
|
||||
const EMPTY_FORM = {
|
||||
new_password: "",
|
||||
new_password_confirmation: "",
|
||||
password: ""
|
||||
};
|
||||
interface ChangePWState { status: SpecialStatus; form: PasswordForm }
|
||||
|
||||
const EMPTY_FORM =
|
||||
({ new_password: "", new_password_confirmation: "", password: "" });
|
||||
|
||||
export class ChangePassword extends React.Component<{}, ChangePWState> {
|
||||
state: ChangePWState = {
|
||||
status: SpecialStatus.SAVED,
|
||||
form: EMPTY_FORM
|
||||
};
|
||||
state: ChangePWState = { status: SpecialStatus.SAVED, form: EMPTY_FORM };
|
||||
|
||||
/** Set the `status` flag to `undefined`, but only if the form is empty.
|
||||
* Useful when the user manually clears the form. */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { browserHistory } from "react-router";
|
||||
export let history = browserHistory;
|
||||
export let push = (url: string) => history.push(url);
|
||||
export let pathname = history.getCurrentLocation().pathname;
|
||||
|
||||
export function getPathArray() {
|
||||
return history.getCurrentLocation().pathname.split("/");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue