Compare commits
No commits in common. "47af75ebd3353b35ecbbdf25dd721917ef834655" and "23ac20c0176a332b13bf9c2c62d261a0ac82c29d" have entirely different histories.
47af75ebd3
...
23ac20c017
@ -7,7 +7,6 @@ import {
|
|||||||
} from '@headlessui/react'
|
} from '@headlessui/react'
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
|
|
||||||
import { LeftArrow } from '~/components/icons/left-arrow'
|
|
||||||
import { APP } from '~/data/meta'
|
import { APP } from '~/data/meta'
|
||||||
|
|
||||||
type ModalProperties = {
|
type ModalProperties = {
|
||||||
@ -35,17 +34,8 @@ export const PopupModal = ({
|
|||||||
className="fixed inset-0 bg-black/50 duration-300 ease-out data-[closed]:opacity-0"
|
className="fixed inset-0 bg-black/50 duration-300 ease-out data-[closed]:opacity-0"
|
||||||
transition
|
transition
|
||||||
/>
|
/>
|
||||||
<div className="fixed inset-0 flex w-screen justify-center overflow-y-auto p-4 max-sm:bg-white sm:items-center">
|
<div className="fixed inset-0 flex w-screen items-center justify-center p-4">
|
||||||
<DialogPanel className="max-w-lg space-y-6 rounded-lg bg-white p-8 duration-300 ease-out data-[closed]:scale-95 data-[closed]:opacity-0 sm:shadow-lg">
|
<DialogPanel className="max-w-lg space-y-6 rounded-lg bg-white p-8 shadow-lg duration-300 ease-out data-[closed]:scale-95 data-[closed]:opacity-0">
|
||||||
<button
|
|
||||||
onClick={onClose}
|
|
||||||
className="top-4 left-4 items-center lg:hidden"
|
|
||||||
>
|
|
||||||
<LeftArrow
|
|
||||||
width={50}
|
|
||||||
height={50}
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
<DialogTitle className="flex justify-center">
|
<DialogTitle className="flex justify-center">
|
||||||
<img
|
<img
|
||||||
src={APP.logo}
|
src={APP.logo}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export default function Banner() {
|
|||||||
className="mt-2 h-full py-2"
|
className="mt-2 h-full py-2"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={'/images/banner.png'}
|
src={'/public/images/banner.png'}
|
||||||
alt={APP.title}
|
alt={APP.title}
|
||||||
className="h-[70px] w-[100%] sm:h-full"
|
className="h-[70px] w-[100%] sm:h-full"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
// import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
// import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
||||||
import { useState, type Dispatch, type SetStateAction } from 'react'
|
import { useState, type Dispatch, type SetStateAction } from 'react'
|
||||||
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
import { EyeIcon } from '~/components/icons/eye'
|
import { EyeIcon } from '~/components/icons/eye'
|
||||||
|
|
||||||
@ -8,11 +9,10 @@ import { Button } from './button'
|
|||||||
type TProperties = {
|
type TProperties = {
|
||||||
setIsRegisterOpen: Dispatch<SetStateAction<boolean>>
|
setIsRegisterOpen: Dispatch<SetStateAction<boolean>>
|
||||||
setIsLoginOpen: Dispatch<SetStateAction<boolean>>
|
setIsLoginOpen: Dispatch<SetStateAction<boolean>>
|
||||||
setIsForgetOpen: Dispatch<SetStateAction<boolean>>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FormLogin = (properties: TProperties) => {
|
export const FormLogin = (properties: TProperties) => {
|
||||||
const { setIsRegisterOpen, setIsLoginOpen, setIsForgetOpen } = properties
|
const { setIsRegisterOpen, setIsLoginOpen } = properties
|
||||||
const [showPassword, setShowPassword] = useState(false)
|
const [showPassword, setShowPassword] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -67,18 +67,14 @@ export const FormLogin = (properties: TProperties) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Lupa Kata Sandi */}
|
{/* Lupa Kata Sandi */}
|
||||||
<div className="mb-4 flex items-center justify-between text-sm">
|
<div className="mb-4 flex justify-between">
|
||||||
<span className="text-gray-600">Lupa Kata Sandi?</span>
|
<span className="text-gray-600">Lupa Kata Sandi?</span>
|
||||||
<Button
|
<Link
|
||||||
onClick={() => {
|
to="/reset-password"
|
||||||
setIsLoginOpen(false)
|
|
||||||
setIsForgetOpen(true)
|
|
||||||
}}
|
|
||||||
className="font-semibold text-[#2E2F7C]"
|
className="font-semibold text-[#2E2F7C]"
|
||||||
variant="link"
|
|
||||||
>
|
>
|
||||||
Reset Kata Sandi
|
Reset Kata Sandi
|
||||||
</Button>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tombol Masuk */}
|
{/* Tombol Masuk */}
|
||||||
|
|||||||
@ -12,8 +12,6 @@ type NewsContextProperties = {
|
|||||||
setIsLoginOpen: Dispatch<SetStateAction<boolean>>
|
setIsLoginOpen: Dispatch<SetStateAction<boolean>>
|
||||||
isRegisterOpen: boolean
|
isRegisterOpen: boolean
|
||||||
setIsRegisterOpen: Dispatch<SetStateAction<boolean>>
|
setIsRegisterOpen: Dispatch<SetStateAction<boolean>>
|
||||||
isForgetOpen: boolean
|
|
||||||
setForgetOpen: Dispatch<SetStateAction<boolean>>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const NewsContext = createContext<NewsContextProperties | undefined>(undefined)
|
const NewsContext = createContext<NewsContextProperties | undefined>(undefined)
|
||||||
@ -21,18 +19,10 @@ const NewsContext = createContext<NewsContextProperties | undefined>(undefined)
|
|||||||
export const NewsProvider = ({ children }: PropsWithChildren) => {
|
export const NewsProvider = ({ children }: PropsWithChildren) => {
|
||||||
const [isLoginOpen, setIsLoginOpen] = useState(false)
|
const [isLoginOpen, setIsLoginOpen] = useState(false)
|
||||||
const [isRegisterOpen, setIsRegisterOpen] = useState(false)
|
const [isRegisterOpen, setIsRegisterOpen] = useState(false)
|
||||||
const [isForgetOpen, setForgetOpen] = useState(false)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewsContext.Provider
|
<NewsContext.Provider
|
||||||
value={{
|
value={{ isLoginOpen, setIsLoginOpen, isRegisterOpen, setIsRegisterOpen }}
|
||||||
isLoginOpen,
|
|
||||||
setIsLoginOpen,
|
|
||||||
isRegisterOpen,
|
|
||||||
setIsRegisterOpen,
|
|
||||||
isForgetOpen,
|
|
||||||
setForgetOpen,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</NewsContext.Provider>
|
</NewsContext.Provider>
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import { type PropsWithChildren } from 'react'
|
|||||||
|
|
||||||
import { PopupModal } from '~/components/popup/modal'
|
import { PopupModal } from '~/components/popup/modal'
|
||||||
import Banner from '~/components/ui/banner'
|
import Banner from '~/components/ui/banner'
|
||||||
import FormForgotPassword from '~/components/ui/form-forgot-password'
|
|
||||||
import { FormLogin } from '~/components/ui/form-login'
|
import { FormLogin } from '~/components/ui/form-login'
|
||||||
import { FormRegister } from '~/components/ui/form-register'
|
import { FormRegister } from '~/components/ui/form-register'
|
||||||
import { useNewsContext } from '~/contexts/news'
|
import { useNewsContext } from '~/contexts/news'
|
||||||
@ -14,14 +13,8 @@ import { HeaderTop } from './header-top'
|
|||||||
|
|
||||||
export const NewsDefaultLayout = (properties: PropsWithChildren) => {
|
export const NewsDefaultLayout = (properties: PropsWithChildren) => {
|
||||||
const { children } = properties
|
const { children } = properties
|
||||||
const {
|
const { isLoginOpen, setIsLoginOpen, isRegisterOpen, setIsRegisterOpen } =
|
||||||
isLoginOpen,
|
useNewsContext()
|
||||||
setIsLoginOpen,
|
|
||||||
isRegisterOpen,
|
|
||||||
setIsRegisterOpen,
|
|
||||||
isForgetOpen,
|
|
||||||
setForgetOpen,
|
|
||||||
} = useNewsContext()
|
|
||||||
return (
|
return (
|
||||||
<main className="relative min-h-dvh bg-[#ECECEC]">
|
<main className="relative min-h-dvh bg-[#ECECEC]">
|
||||||
<header>
|
<header>
|
||||||
@ -46,25 +39,16 @@ export const NewsDefaultLayout = (properties: PropsWithChildren) => {
|
|||||||
<FormLogin
|
<FormLogin
|
||||||
setIsRegisterOpen={setIsRegisterOpen}
|
setIsRegisterOpen={setIsRegisterOpen}
|
||||||
setIsLoginOpen={setIsLoginOpen}
|
setIsLoginOpen={setIsLoginOpen}
|
||||||
setIsForgetOpen={setForgetOpen}
|
|
||||||
/>
|
/>
|
||||||
</PopupModal>
|
</PopupModal>
|
||||||
|
|
||||||
<PopupModal
|
<PopupModal
|
||||||
isOpen={isRegisterOpen}
|
isOpen={isRegisterOpen}
|
||||||
onClose={() => setIsRegisterOpen(false)}
|
onClose={() => setIsRegisterOpen(false)}
|
||||||
description="Selamat Datang, silakan isi keterangan akun Anda untuk melanjutkan!"
|
description="Selamat Datang, silakan daftarkan akun Anda untuk melanjutkan!"
|
||||||
>
|
>
|
||||||
<FormRegister />
|
<FormRegister />
|
||||||
</PopupModal>
|
</PopupModal>
|
||||||
|
|
||||||
<PopupModal
|
|
||||||
isOpen={isForgetOpen}
|
|
||||||
onClose={() => setForgetOpen(false)}
|
|
||||||
description="Selamat Datang, silakan isi keterangan akun Anda untuk melanjutkan!"
|
|
||||||
>
|
|
||||||
<FormForgotPassword />
|
|
||||||
</PopupModal>
|
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user