From 6d965b5a03b5609ef00a790b024d58246832cd81 Mon Sep 17 00:00:00 2001 From: z1glr Date: Thu, 30 Jan 2025 19:33:17 +0000 Subject: [PATCH] Added password changing confirmation --- client/src/app/account/page.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/client/src/app/account/page.tsx b/client/src/app/account/page.tsx index 2e9397b..9bdfe1e 100644 --- a/client/src/app/account/page.tsx +++ b/client/src/app/account/page.tsx @@ -2,6 +2,7 @@ import { apiCall, validatePassword as validatePassword } from "@/lib"; import { + Alert, Button, Card, CardBody, @@ -14,6 +15,8 @@ import { FormEvent, useState } from "react"; export default function Account() { const [password, setPassword] = useState(""); + const [showSuccess, setShowSuccess] = useState(false); + const errors = validatePassword(password); async function changePassword(e: FormEvent) { @@ -23,6 +26,7 @@ export default function Account() { if (result.ok) { setPassword(""); + setShowSuccess(true); } } @@ -42,10 +46,10 @@ export default function Account() { changePassword(e); }} > - + } /> + setShowSuccess(false)} + title="Success" + color="success" + variant="faded" + > + Password changed successfully +