Cleanup part I

pull/692/head
Rick Carlino 2018-03-02 09:04:03 -06:00
parent 393337e1c9
commit 9da7881c5c
2 changed files with 6 additions and 14 deletions

View File

@ -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. */

View File

@ -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("/");
}