From 0d3f3bc2e71b88204bd423e55d9c92ce6030f8a6 Mon Sep 17 00:00:00 2001 From: sabdayagra Date: Tue, 14 Jan 2025 21:58:15 +0700 Subject: [PATCH] fix: fixed registration landing --- app/[locale]/(public)/image/filter/page.tsx | 2 +- app/[locale]/(public)/video/filter/page.tsx | 9 +- app/[locale]/auth/registration/page.tsx | 217 ++++++++++++-------- 3 files changed, 129 insertions(+), 99 deletions(-) diff --git a/app/[locale]/(public)/image/filter/page.tsx b/app/[locale]/(public)/image/filter/page.tsx index 8ef407d3..32a75b58 100644 --- a/app/[locale]/(public)/image/filter/page.tsx +++ b/app/[locale]/(public)/image/filter/page.tsx @@ -371,7 +371,7 @@ const FilterPage = () => { {/* Left */}
-
+

Filter diff --git a/app/[locale]/(public)/video/filter/page.tsx b/app/[locale]/(public)/video/filter/page.tsx index e0e1514b..b24a6279 100644 --- a/app/[locale]/(public)/video/filter/page.tsx +++ b/app/[locale]/(public)/video/filter/page.tsx @@ -96,10 +96,6 @@ const FilterPage = () => { } }, [categorie]); - // useEffect(() => { - // fetchData(); - // }, [page, sortBy, sortByOpt, title]); - useEffect(() => { async function initState() { if (isRegional) { @@ -108,9 +104,8 @@ const FilterPage = () => { getDataAll(); } } - console.log(monthYearFilter, "monthFilter"); initState(); - }, [change, asPath, monthYearFilter, page, sortBy, sortByOpt, title, startDateString, endDateString, categorie, formatFilter]); + }, [locale, change, asPath, monthYearFilter, page, sortBy, sortByOpt, title, startDateString, endDateString, categorie, formatFilter]); async function getCategories() { const category = await listCategory("2"); @@ -290,7 +285,7 @@ const FilterPage = () => { size: 6, sortBy: "createdAt", contentTypeId: "2", - isInt: locale == "en" ? true : false, + isInt: locale == "in" ? true : false, }); console.log(response); setVideoData(response?.data?.data?.content); diff --git a/app/[locale]/auth/registration/page.tsx b/app/[locale]/auth/registration/page.tsx index b59c4eec..7a369845 100644 --- a/app/[locale]/auth/registration/page.tsx +++ b/app/[locale]/auth/registration/page.tsx @@ -1,11 +1,11 @@ "use client"; +import React from "react"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import Image from "next/image"; - import { close, error, loading, registerConfirm } from "@/config/swal"; import { Link, useRouter } from "@/i18n/routing"; import { getDataByNIK, getDataByNRP, getDataJournalist, getDataPersonil, listCity, listDistricts, listInstitusi, listProvince, postRegistration, saveInstitutes } from "@/service/auth"; @@ -52,7 +52,6 @@ const page = () => { const [emailValidate, setEmailValidate] = useState(""); const [otpValidate, setOtpValidate] = useState(""); const [password, setPassword] = useState(""); - const [passwordConf, setPasswordConf] = useState(""); const [city, setCity] = useState([]); const [isValidPassword, setIsValidPassword] = useState(false); const MySwal = withReactContent(Swal); @@ -80,6 +79,14 @@ const page = () => { const nSecondInMiliseconds = 1000; const [, setRefreshTimer] = useState(false); + const [passwordType, setPasswordType] = React.useState("password"); + const [passwordConf, setPasswordConf] = React.useState("password"); + + const togglePasswordType = () => { + setPasswordType((prevType) => (prevType === "password" ? "text" : "password")); + setPasswordConf((prevType) => (prevType === "same password" ? "text" : "same password")); + }; + const validationSchema = Yup.object().shape({ firstName: Yup.string().required("Nama Lengkap tidak boleh kosong"), username: Yup.string().required("Username tidak boleh kosong"), @@ -106,22 +113,6 @@ const page = () => { let [timerCount, setTimerCount] = useState(convertMinutesToMiliseconds(1)); let interval: any; - const showPass = () => { - setTypePass("text"); - }; - - const hidePass = () => { - setTypePass("password"); - }; - - const showPassConf = () => { - setTypePassConf("text"); - }; - - const hidePassConf = () => { - setTypePassConf("password"); - }; - const setValUsername = (e: any) => { const uname = e.replaceAll(/[^\w.-]/g, ""); setValue("username", uname.toLowerCase()); @@ -513,19 +504,6 @@ const page = () => { initState(); }, [institusi]); - useEffect(() => { - async function initState() { - if (category != undefined) { - const resInstiution = await listInstitusi(category); - const res = await listProvince(); - setInstitution(resInstiution?.data.data); - setProvince(res?.data.data); - } - } - - initState(); - }, [category]); - return (
@@ -618,10 +596,10 @@ const page = () => { } } > -
{Number(category) == 7 ? ( -
+
@@ -657,7 +635,7 @@ const page = () => { )} {Number(category) == 6 ? (
{ } } > - + setJournalistCertificate(event.target.value)} />
) : ( @@ -715,17 +693,18 @@ const page = () => {
-
+
{Number(category) == 6 || Number(category) == 7 ? ( -
-