From 169f264b503f435dd4c1daa7d11f1f2cac307919 Mon Sep 17 00:00:00 2001 From: "fredy.siswanto" Date: Sat, 22 Feb 2025 21:17:56 +0700 Subject: [PATCH 1/2] feat: fix conflic --- app/components/popup/modal.tsx | 14 +++++++++++-- app/components/ui/banner.tsx | 2 +- app/components/ui/form-login.tsx | 16 +++++++++------ app/contexts/news.tsx | 12 ++++++++++- app/layouts/news/default.tsx | 22 ++++++++++++++++++--- app/routes/_layout.dashboard.auth.login.tsx | 2 +- 6 files changed, 54 insertions(+), 14 deletions(-) diff --git a/app/components/popup/modal.tsx b/app/components/popup/modal.tsx index fa40245..c0e54b9 100644 --- a/app/components/popup/modal.tsx +++ b/app/components/popup/modal.tsx @@ -7,6 +7,7 @@ import { } from '@headlessui/react' import type { ReactNode } from 'react' +import { LeftArrow } from '~/components/icons/left-arrow' import { APP } from '~/data/meta' type ModalProperties = { @@ -34,8 +35,17 @@ export const PopupModal = ({ className="fixed inset-0 bg-black/50 duration-300 ease-out data-[closed]:opacity-0" transition /> -
- +
+ + {APP.title} diff --git a/app/components/ui/form-login.tsx b/app/components/ui/form-login.tsx index 9c84f0b..dff3dcd 100644 --- a/app/components/ui/form-login.tsx +++ b/app/components/ui/form-login.tsx @@ -1,6 +1,5 @@ // import { EyeIcon, EyeOffIcon } from 'lucide-react' import { useState, type Dispatch, type SetStateAction } from 'react' -import { Link } from 'react-router' import { EyeIcon } from '~/components/icons/eye' @@ -9,10 +8,11 @@ import { Button } from './button' type TProperties = { setIsRegisterOpen: Dispatch> setIsLoginOpen: Dispatch> + setIsForgetOpen: Dispatch> } export const FormLogin = (properties: TProperties) => { - const { setIsRegisterOpen, setIsLoginOpen } = properties + const { setIsRegisterOpen, setIsLoginOpen, setIsForgetOpen } = properties const [showPassword, setShowPassword] = useState(false) return ( @@ -67,14 +67,18 @@ export const FormLogin = (properties: TProperties) => {
{/* Lupa Kata Sandi */} -
+
Lupa Kata Sandi? - { + setIsLoginOpen(false) + setIsForgetOpen(true) + }} className="font-semibold text-[#2E2F7C]" + variant="link" > Reset Kata Sandi - +
{/* Tombol Masuk */} diff --git a/app/contexts/news.tsx b/app/contexts/news.tsx index d023b84..8487b79 100644 --- a/app/contexts/news.tsx +++ b/app/contexts/news.tsx @@ -10,6 +10,8 @@ type NewsContextProperties = { setIsLoginOpen: React.Dispatch> isRegisterOpen: boolean setIsRegisterOpen: React.Dispatch> + isForgetOpen: boolean + setForgetOpen: React.Dispatch> } const NewsContext = createContext(undefined) @@ -17,10 +19,18 @@ const NewsContext = createContext(undefined) export const NewsProvider = ({ children }: PropsWithChildren) => { const [isLoginOpen, setIsLoginOpen] = useState(false) const [isRegisterOpen, setIsRegisterOpen] = useState(false) + const [isForgetOpen, setForgetOpen] = useState(false) return ( {children} diff --git a/app/layouts/news/default.tsx b/app/layouts/news/default.tsx index ad3c2ae..9683fae 100644 --- a/app/layouts/news/default.tsx +++ b/app/layouts/news/default.tsx @@ -2,6 +2,7 @@ import { type PropsWithChildren } from 'react' import { PopupModal } from '~/components/popup/modal' import Banner from '~/components/ui/banner' +import FormForgotPassword from '~/components/ui/form-forgot-password' import { FormLogin } from '~/components/ui/form-login' import { FormRegister } from '~/components/ui/form-register' import { useNewsContext } from '~/contexts/news' @@ -13,8 +14,14 @@ import { HeaderTop } from './header-top' export const NewsDefaultLayout = (properties: PropsWithChildren) => { const { children } = properties - const { isLoginOpen, setIsLoginOpen, isRegisterOpen, setIsRegisterOpen } = - useNewsContext() + const { + isLoginOpen, + setIsLoginOpen, + isRegisterOpen, + setIsRegisterOpen, + isForgetOpen, + setForgetOpen, + } = useNewsContext() return (
@@ -39,16 +46,25 @@ export const NewsDefaultLayout = (properties: PropsWithChildren) => { setIsRegisterOpen(false)} - description="Selamat Datang, silakan daftarkan akun Anda untuk melanjutkan!" + description="Selamat Datang, silakan isi keterangan akun Anda untuk melanjutkan!" > + + setForgetOpen(false)} + description="Selamat Datang, silakan isi keterangan akun Anda untuk melanjutkan!" + > + +
) } diff --git a/app/routes/_layout.dashboard.auth.login.tsx b/app/routes/_layout.dashboard.auth.login.tsx index d67b1bb..e39568b 100644 --- a/app/routes/_layout.dashboard.auth.login.tsx +++ b/app/routes/_layout.dashboard.auth.login.tsx @@ -2,7 +2,7 @@ const AuthLayout = () => { return (
- Login form + Login
) From ee663c1bf5af9cd30d921340c33c8221ae48c96e Mon Sep 17 00:00:00 2001 From: "fredy.siswanto" Date: Sat, 22 Feb 2025 21:34:09 +0700 Subject: [PATCH 2/2] fix: improve modal layout by adding overflow handling and adjusting button visibility --- app/components/popup/modal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/popup/modal.tsx b/app/components/popup/modal.tsx index c0e54b9..d814d6f 100644 --- a/app/components/popup/modal.tsx +++ b/app/components/popup/modal.tsx @@ -35,11 +35,11 @@ export const PopupModal = ({ className="fixed inset-0 bg-black/50 duration-300 ease-out data-[closed]:opacity-0" transition /> -
+