Skip to content

Commit

Permalink
feat(auth): add cancel for reset password page (#4735)
Browse files Browse the repository at this point in the history
* feat(auth): add cancel for reset password page

* styles

* lint
  • Loading branch information
Parker-Stafford authored Sep 25, 2024
1 parent 62dd2e7 commit fe5e043
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions app/src/pages/auth/ResetPasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useCallback } from "react";
import { Controller, useForm } from "react-hook-form";
import { graphql, useMutation } from "react-relay";
import { useNavigate } from "react-router";
import { css } from "@emotion/react";

import { Button, Flex, Form, TextField, View } from "@arizeai/components";
import { Button, Form, TextField, View } from "@arizeai/components";

import { useNotifyError } from "@phoenix/contexts";
import { createRedirectUrlWithReturn } from "@phoenix/utils/routingUtils";
Expand All @@ -28,11 +29,7 @@ export function ResetPasswordForm() {
}
}
`);
const {
control,
handleSubmit,
formState: { isDirty },
} = useForm<ResetPasswordFormParams>({
const { control, handleSubmit } = useForm<ResetPasswordFormParams>({
defaultValues: {
currentPassword: "",
newPassword: "",
Expand Down Expand Up @@ -154,15 +151,28 @@ export function ResetPasswordForm() {
)}
/>
<View paddingTop="size-200">
<Flex direction="row" gap="size-100" justifyContent="end">
<div
css={css`
display: flex;
flex-direction: row;
gap: var(--ac-global-dimension-size-200);
& > * {
width: 50%;
}
`}
>
<Button
variant={isDirty ? "primary" : "default"}
type="submit"
disabled={isCommitting}
variant="default"
onClick={() => {
navigate(-1);
}}
>
Cancel
</Button>
<Button variant={"primary"} type="submit" disabled={isCommitting}>
{isCommitting ? "Resetting..." : "Reset Password"}
</Button>
</Flex>
</div>
</View>
</Form>
);
Expand Down

0 comments on commit fe5e043

Please sign in to comment.