From 021b4e8ae50a72c7418a727cc4fb5f8c727358b9 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Sat, 7 Feb 2026 20:57:03 +0000 Subject: [PATCH] controllers --- client/src/Pages/Account/TabPassword.tsx | 89 ++++++++++++++++++++---- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/client/src/Pages/Account/TabPassword.tsx b/client/src/Pages/Account/TabPassword.tsx index cd07410ac..cdf7ce4c4 100644 --- a/client/src/Pages/Account/TabPassword.tsx +++ b/client/src/Pages/Account/TabPassword.tsx @@ -1,24 +1,51 @@ import { Stack } from "@mui/material"; import { ConfigBox } from "@/Components/v2/design-elements"; -import { TextField } from "@/Components/v2/inputs"; +import { TextField, Button } from "@/Components/v2/inputs"; import { useTranslation } from "react-i18next"; import { useTheme } from "@mui/material"; +import { useForm, Controller } from "react-hook-form"; +import { usePasswordForm } from "@/Hooks/usePasswordForm"; +import type { PasswordFormData } from "@/Validation/password"; export const TabPassword = () => { const { t } = useTranslation(); const theme = useTheme(); + const { resolver, defaults } = usePasswordForm(); + + const { control, handleSubmit } = useForm({ + resolver, + defaultValues: defaults, + }); + + const onSubmit = (data: PasswordFormData) => { + console.log("Password form data:", data); + }; return ( - + ( + + )} /> } /> @@ -27,21 +54,53 @@ export const TabPassword = () => { subtitle={t("pages.account.form.newPassword.description")} rightContent={ - ( + )} /> - ( + + )} /> } /> + ); };