From 9374441e459a5d0fbbbbc2c7f339bb74fafdbd40 Mon Sep 17 00:00:00 2001 From: Zewed Date: Wed, 27 Mar 2024 14:35:17 -0700 Subject: [PATCH] fix dark mode in login --- .../EmailLogin/components/EmailInput.tsx | 28 ++++------ .../PasswordLogin/PasswordLogin.tsx | 25 +++++---- frontend/app/(auth)/login/page.module.scss | 46 ++++++++++++++++ frontend/app/(auth)/login/page.tsx | 50 ++++++++--------- frontend/app/(home)/page.tsx | 55 ++----------------- .../lib/components/ui/TextInput/TextInput.tsx | 4 +- .../User-settings.provider.tsx | 6 +- 7 files changed, 106 insertions(+), 108 deletions(-) create mode 100644 frontend/app/(auth)/login/page.module.scss diff --git a/frontend/app/(auth)/login/components/EmailLogin/components/EmailInput.tsx b/frontend/app/(auth)/login/components/EmailLogin/components/EmailInput.tsx index 929a8004d..2d71f0c15 100644 --- a/frontend/app/(auth)/login/components/EmailLogin/components/EmailInput.tsx +++ b/frontend/app/(auth)/login/components/EmailLogin/components/EmailInput.tsx @@ -1,30 +1,26 @@ import { Fragment } from "react"; -import { useFormContext } from "react-hook-form"; -import { useTranslation } from "react-i18next"; +import { Controller } from "react-hook-form"; -import Field from "@/lib/components/ui/Field"; -import { emailPattern } from "@/lib/config/patterns"; +import { TextInput } from "@/lib/components/ui/TextInput/TextInput"; import { useAuthModes } from "@/lib/hooks/useAuthModes"; -import { EmailAuthContextType } from "../../../types"; - export const EmailInput = (): JSX.Element => { - const { register } = useFormContext(); - const { t } = useTranslation(); const { password, magicLink } = useAuthModes(); if (!password && !magicLink) { return ; } return ( - ( + + )} /> ); }; diff --git a/frontend/app/(auth)/login/components/EmailLogin/components/PasswordLogin/PasswordLogin.tsx b/frontend/app/(auth)/login/components/EmailLogin/components/PasswordLogin/PasswordLogin.tsx index 65cbff5a2..a0f5ee514 100644 --- a/frontend/app/(auth)/login/components/EmailLogin/components/PasswordLogin/PasswordLogin.tsx +++ b/frontend/app/(auth)/login/components/EmailLogin/components/PasswordLogin/PasswordLogin.tsx @@ -1,10 +1,10 @@ import { Fragment } from "react"; -import { useFormContext } from "react-hook-form"; +import { Controller, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { EmailAuthContextType } from "@/app/(auth)/login/types"; import Button from "@/lib/components/ui/Button"; -import Field from "@/lib/components/ui/Field"; +import { TextInput } from "@/lib/components/ui/TextInput/TextInput"; import { useAuthModes } from "@/lib/hooks/useAuthModes"; import { usePasswordLogin } from "./hooks/usePasswordLogin"; @@ -13,7 +13,7 @@ export const PasswordLogin = (): JSX.Element => { const { t } = useTranslation(["login"]); const { password } = useAuthModes(); const { handlePasswordLogin } = usePasswordLogin(); - const { register, watch } = useFormContext(); + const { watch } = useFormContext(); if (!password) { return ; @@ -21,17 +21,22 @@ export const PasswordLogin = (): JSX.Element => { return (
- ( + + )} />