From 090c0d1c3c1b6bf2f569eb4c9e1164523f048319 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 7 Jun 2025 15:11:29 +0000 Subject: feat(web): Redesign the user settings page --- apps/web/components/settings/ChangePassword.tsx | 225 ++++++++++++++++-------- 1 file changed, 150 insertions(+), 75 deletions(-) (limited to 'apps/web/components/settings/ChangePassword.tsx') diff --git a/apps/web/components/settings/ChangePassword.tsx b/apps/web/components/settings/ChangePassword.tsx index f8c2b8dd..703b9c16 100644 --- a/apps/web/components/settings/ChangePassword.tsx +++ b/apps/web/components/settings/ChangePassword.tsx @@ -1,6 +1,7 @@ "use client"; import type { z } from "zod"; +import { useState } from "react"; import { ActionButton } from "@/components/ui/action-button"; import { Form, @@ -15,12 +16,19 @@ import { toast } from "@/components/ui/use-toast"; import { useTranslation } from "@/lib/i18n/client"; import { api } from "@/lib/trpc"; import { zodResolver } from "@hookform/resolvers/zod"; +import { Eye, EyeOff, Lock } from "lucide-react"; import { useForm } from "react-hook-form"; import { zChangePasswordSchema } from "@karakeep/shared/types/users"; +import { Button } from "../ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "../ui/card"; + export function ChangePassword() { const { t } = useTranslation(); + const [showCurrentPassword, setShowCurrentPassword] = useState(false); + const [showNewPassword, setShowNewPassword] = useState(false); + const [showConfirmPassword, setShowConfirmPassword] = useState(false); const form = useForm>({ resolver: zodResolver(zChangePasswordSchema), defaultValues: { @@ -55,83 +63,150 @@ export function ChangePassword() { } return ( -
-
- {t("settings.info.change_password")} -
-
- - { - return ( - - {t("settings.info.current_password")} - - - - - - ); - }} - /> - { - return ( - - {t("settings.info.new_password")} - - - - - - ); - }} - /> - { - return ( - - - {t("settings.info.confirm_new_password")} + + + + + Security + + + + + + ( + + + {t("settings.info.current_password")} - - - +
+ + + + +
- ); - }} - /> - - {t("actions.save")} - - - -
+ )} + /> + +
+ ( + + + {t("settings.info.new_password")} + +
+ + + + +
+ +
+ )} + /> + + ( + + + {t("settings.info.confirm_new_password")} + +
+ + + + +
+ +
+ )} + /> +
+ +
+ + {t("actions.save")} + +
+ + + + ); } -- cgit v1.2.3-70-g09d2