feat: update News context to use consistent setter naming and refactor FormLogin to utilize context

This commit is contained in:
Ardeman
2025-02-28 22:50:58 +08:00
parent 3f9bfded80
commit 13f44f336d
4 changed files with 28 additions and 21 deletions
+19
View File
@@ -1,9 +1,12 @@
import { useState } from 'react'
import { Button } from '~/components/ui/button'
import { useNewsContext } from '~/contexts/news'
export const FormRegister = () => {
const { setIsLoginOpen, setIsRegisterOpen } = useNewsContext()
const [showPassword, setShowPassword] = useState(false)
return (
<div className="flex flex-col items-center justify-center">
<div className="w-full max-w-md">
@@ -104,6 +107,22 @@ export const FormRegister = () => {
Daftar
</Button>
</form>
{/* Link Login */}
<div className="mt-4 text-center text-sm">
Sudah punya akun?{' '}
<Button
onClick={() => {
setIsLoginOpen(true)
setIsRegisterOpen(false)
}}
className="font-semibold text-[#2E2F7C]"
variant="link"
size="fit"
>
Masuk Disini
</Button>
</div>
</div>
</div>
)