From 00df44e6f25eaeabc56ebba8b4e9b1cb692928d7 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 20 Aug 2024 10:27:32 +0700
Subject: <iman> add new register

---
 src-migrate/modules/register/index.tsx | 126 ++++++++++++++++++++++++---------
 1 file changed, 92 insertions(+), 34 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index 00931284..9b3f5509 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -1,43 +1,101 @@
-import PageContent from "~/modules/page-content"
-import Form from "./components/Form"
-import Link from "next/link"
-import Image from "next/image"
-import IndoteknikLogo from "~/images/logo.png"
-import AccountActivation from "../account-activation"
+import PageContent from "~/modules/page-content";
+import Form from "./components/Form";
+import RegistrasiIndividu from "./components/RegistrasiIndividu";
+import RegistrasiBisnis from "./components/RegistrasiBisnis";
+import FormBisnis from "./components/FormBisnis";
+import Link from "next/link";
+import Image from "next/image";
+import IndoteknikLogo from "~/images/logo.png";
+import AccountActivation from "../account-activation";
+import { useState } from "react";
 
 const LOGO_WIDTH = 150;
 const LOGO_HEIGHT = LOGO_WIDTH / 3;
 
 const Register = () => {
+  const [isIndividuClicked, setIsIndividuClicked] = useState(true);
+  const [isBisnisClicked, setIsBisnisClicked] = useState(false);
+
+  const handleIndividuClick = () => {
+    setIsIndividuClicked(true);
+    setIsBisnisClicked(false);
+  };
+
+  const handleBisnisClick = () => {
+    setIsIndividuClicked(false);
+    setIsBisnisClicked(true);
+  };
+
   return (
     <div className="container">
-      <div className="grid grid-cols-1 md:grid-cols-2 gap-x-10 pt-10 px-2 md:pt-16">
-        <section>
-          <Link href='/' className="block md:hidden">
-            <Image src={IndoteknikLogo} alt='Logo Indoteknik' width={LOGO_WIDTH} height={LOGO_HEIGHT} className="mx-auto mb-4 w-auto h-auto" priority />
-          </Link>
-
-          <h1 className="text-2xl font-semibold text-center md:text-left">
-            Daftar Akun Indoteknik
-          </h1>
-          <h2 className="text-gray_r-11 mt-1 mb-10 text-center md:text-left">
-            Buat akun sekarang lebih mudah dan terverifikasi
-          </h2>
-
-          <Form />
-
-          <div className='text-gray_r-11 mt-4 text-center md:text-left'>
-            Sudah punya akun Indoteknik?{' '}
-            <Link href='/login' className='inline font-medium text-danger-500'>
-              Masuk
+      <div className="grid grid-cols-1 md:grid-cols-2 gap-x-8 pt-10 px-2 md:pt-16">
+        <section className="border">
+          <div className="px-8 py-4">
+            <Link href="/" className="block md:hidden">
+              <Image
+                src={IndoteknikLogo}
+                alt="Logo Indoteknik"
+                width={LOGO_WIDTH}
+                height={LOGO_HEIGHT}
+                className="mx-auto mb-4 w-auto h-auto"
+                priority
+              />
             </Link>
-          </div>
 
-          <div className='text-gray_r-11 mt-4 text-center md:text-left'>
-            Akun anda belum aktif?{' '}
-            <Link href='/register?activation=email' className='inline font-medium text-danger-500'>
-              Aktivasi
-            </Link>
+            <h1 className="text-2xl font-semibold text-center md:text-left">
+              Daftar Akun Indoteknik
+            </h1>
+            <h2 className="text-gray_r-11 mt-1 mb-10 text-center md:text-left">
+              Buat akun sekarang lebih mudah dan terverifikasi
+            </h2>
+
+            <label htmlFor="name" className="text-black font-bold">
+              Tipe Akun
+            </label>
+            <div className="grid grid-cols-2 gap-x-3 h-10 font-bold text-black hover:cursor-pointer">
+              <div
+                className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
+                  isIndividuClicked ? "bg-red-500 text-white" : ""
+                }`}
+                onClick={handleIndividuClick}
+              >
+                <p>Individu</p>
+              </div>
+              <div
+                className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
+                  isBisnisClicked ? "bg-red-500 text-white" : ""
+                }`}
+                onClick={handleBisnisClick}
+              >
+                <p>Bisnis</p>
+              </div>
+            </div>
+            <div className="transition-opacity duration-300 ease-in-out">
+              {isIndividuClicked && (
+                <div className="opacity-100">
+                  <RegistrasiIndividu />
+                </div>
+              )}
+              {isBisnisClicked && (
+                <div className="opacity-100">
+                  <RegistrasiBisnis />
+                </div>
+              )}
+            </div>
+            <section className="flex justify-center items-center flex-col">
+              <div className="text-gray_r-11 mt-4 text-center md:text-left">
+                Sudah punya akun Indoteknik?{" "}
+                <Link href="/login" className="inline font-medium text-danger-500">
+                  Masuk
+                </Link>
+              </div>
+              <div className="text-gray_r-11 mt-4 text-center md:text-left">
+                Akun anda belum aktif?{" "}
+                <Link href="/register?activation=email" className="inline font-medium text-danger-500">
+                  Aktivasi
+                </Link>
+              </div>
+            </section>
           </div>
         </section>
 
@@ -48,7 +106,7 @@ const Register = () => {
 
       <AccountActivation />
     </div>
-  )
-}
+  );
+};
 
-export default Register
\ No newline at end of file
+export default Register;
-- 
cgit v1.2.3


From cf0f7a934bcf256d1daeee98e9f66397fb64b1ee Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 20 Aug 2024 11:47:29 +0700
Subject: <iman> update new register

---
 src-migrate/modules/register/index.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index 9b3f5509..e89a6de3 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -45,14 +45,14 @@ const Register = () => {
             <h1 className="text-2xl font-semibold text-center md:text-left">
               Daftar Akun Indoteknik
             </h1>
-            <h2 className="text-gray_r-11 mt-1 mb-10 text-center md:text-left">
+            <h2 className="text-gray_r-11 mt-1 mb-4 text-center md:text-left">
               Buat akun sekarang lebih mudah dan terverifikasi
             </h2>
 
             <label htmlFor="name" className="text-black font-bold">
               Tipe Akun
             </label>
-            <div className="grid grid-cols-2 gap-x-3 h-10 font-bold text-black hover:cursor-pointer">
+            <div className="grid grid-cols-2 gap-x-3 mt-2 h-10 font-bold text-black hover:cursor-pointer">
               <div
                 className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
                   isIndividuClicked ? "bg-red-500 text-white" : ""
-- 
cgit v1.2.3


From 2f106583f644e29019828a9e8ed82e23c7c67d0a Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 21 Aug 2024 10:01:27 +0700
Subject: <iman> update view new register

---
 src-migrate/modules/register/index.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index e89a6de3..da41a5bb 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -52,7 +52,7 @@ const Register = () => {
             <label htmlFor="name" className="text-black font-bold">
               Tipe Akun
             </label>
-            <div className="grid grid-cols-2 gap-x-3 mt-2 h-10 font-bold text-black hover:cursor-pointer">
+            <div className="grid grid-cols-2 gap-x-3 mt-2 h-14 font-bold text-black hover:cursor-pointer">
               <div
                 className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
                   isIndividuClicked ? "bg-red-500 text-white" : ""
-- 
cgit v1.2.3


From f0cde08a3fda95b1738a765358022241aea404bf Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 26 Aug 2024 10:28:15 +0700
Subject: <iman> update logic new register validation

---
 src-migrate/modules/register/index.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index da41a5bb..5df2476e 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -8,6 +8,7 @@ import Image from "next/image";
 import IndoteknikLogo from "~/images/logo.png";
 import AccountActivation from "../account-activation";
 import { useState } from "react";
+import { useRegisterStore } from "./stores/useRegisterStore";
 
 const LOGO_WIDTH = 150;
 const LOGO_HEIGHT = LOGO_WIDTH / 3;
@@ -15,13 +16,20 @@ const LOGO_HEIGHT = LOGO_WIDTH / 3;
 const Register = () => {
   const [isIndividuClicked, setIsIndividuClicked] = useState(true);
   const [isBisnisClicked, setIsBisnisClicked] = useState(false);
+  const {resetForm,
+    updateForm
+  } = useRegisterStore()
 
   const handleIndividuClick = () => {
+    resetForm();
     setIsIndividuClicked(true);
     setIsBisnisClicked(false);
   };
-
+  
   const handleBisnisClick = () => {
+    resetForm();
+    updateForm("is_terdaftar", 'false')
+    updateForm("type_acc", 'business')
     setIsIndividuClicked(false);
     setIsBisnisClicked(true);
   };
-- 
cgit v1.2.3


From 54b6b618effc8416027ed884be1d6d37257c26c4 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 26 Aug 2024 11:59:57 +0700
Subject: <iman> update fungsion component

---
 src-migrate/modules/register/index.tsx | 71 ++++++++++++++++++++++++++++++++--
 1 file changed, 67 insertions(+), 4 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index 5df2476e..bb94d170 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -7,8 +7,16 @@ import Link from "next/link";
 import Image from "next/image";
 import IndoteknikLogo from "~/images/logo.png";
 import AccountActivation from "../account-activation";
-import { useState } from "react";
+import { useMemo, useState } from "react";
 import { useRegisterStore } from "./stores/useRegisterStore";
+import FormCaptcha from "./components/FormCaptcha";
+import TermCondition from "./components/TermCondition";
+import {  Button } from '@chakra-ui/react'
+import { useMutation } from "react-query";
+import { UseToastOptions, useToast } from "@chakra-ui/react";
+import { RegisterProps } from "~/types/auth";
+import { registerUser } from "~/services/auth";
+import { useRouter } from "next/router";
 
 const LOGO_WIDTH = 150;
 const LOGO_HEIGHT = LOGO_WIDTH / 3;
@@ -16,10 +24,17 @@ const LOGO_HEIGHT = LOGO_WIDTH / 3;
 const Register = () => {
   const [isIndividuClicked, setIsIndividuClicked] = useState(true);
   const [isBisnisClicked, setIsBisnisClicked] = useState(false);
-  const {resetForm,
+  const {form, isCheckedTNC, isValidCaptcha, resetForm,errors,
     updateForm
   } = useRegisterStore()
 
+  const  isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors])
+  const toast = useToast()
+  const router = useRouter()
+  const mutation = useMutation({
+    mutationFn: (data: RegisterProps) => registerUser(data)
+  })
+
   const handleIndividuClick = () => {
     resetForm();
     setIsIndividuClicked(true);
@@ -33,12 +48,46 @@ const Register = () => {
     setIsIndividuClicked(false);
     setIsBisnisClicked(true);
   };
+  const handleSubmit = async () => {
+    const response = await mutation.mutateAsync(form)
+    if (response?.register === true) {
+      const urlParams = new URLSearchParams({
+        activation: 'otp',
+        email: form.email,
+        redirect: (router.query?.next || '/') as string
+      })
+      router.push(`${router.route}?${urlParams}`)
+    }
+
+    const toastProps: UseToastOptions = {
+      duration: 5000,
+      isClosable: true
+    }
 
+    switch (response?.reason) {
+      case 'EMAIL_USED':
+        toast({
+          ...toastProps,
+          title: 'Email sudah digunakan',
+          status: 'warning'
+        })
+        break;
+      case 'NOT_ACTIVE':
+        const activationUrl = `${router.route}?activation=email`
+        toast({
+          ...toastProps,
+          title: 'Akun belum aktif',
+          description: <>Akun sudah terdaftar namun belum aktif. <Link href={activationUrl} className="underline">Klik untuk aktivasi akun</Link></>,
+          status: 'warning'
+        })
+        break
+    }
+  };
   return (
     <div className="container">
       <div className="grid grid-cols-1 md:grid-cols-2 gap-x-8 pt-10 px-2 md:pt-16">
-        <section className="border">
-          <div className="px-8 py-4">
+        <section className="">
+          <div className="px-8 py-4 border">
             <Link href="/" className="block md:hidden">
               <Image
                 src={IndoteknikLogo}
@@ -90,6 +139,20 @@ const Register = () => {
                 </div>
               )}
             </div>
+            <section className="mt-2">
+              <FormCaptcha />
+              <TermCondition />
+              <Button
+                type="submit"
+                colorScheme="red"
+                className="w-full mt-2"
+                size='lg'
+                onClick={handleSubmit}
+                isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}  
+              >
+                {mutation.isLoading ? 'Loading...' : 'Daftar'}
+              </Button>
+            </section>
             <section className="flex justify-center items-center flex-col">
               <div className="text-gray_r-11 mt-4 text-center md:text-left">
                 Sudah punya akun Indoteknik?{" "}
-- 
cgit v1.2.3


From 8a6578b299c6fd26e2ef63b88cf7ebb522a83538 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 26 Aug 2024 15:09:25 +0700
Subject: <iman> chapta comment to avoid error

---
 src-migrate/modules/register/index.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index bb94d170..31e09088 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -140,7 +140,7 @@ const Register = () => {
               )}
             </div>
             <section className="mt-2">
-              <FormCaptcha />
+              {/* <FormCaptcha /> */}
               <TermCondition />
               <Button
                 type="submit"
@@ -148,7 +148,8 @@ const Register = () => {
                 className="w-full mt-2"
                 size='lg'
                 onClick={handleSubmit}
-                isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}  
+                // isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}  
+                isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading}  
               >
                 {mutation.isLoading ? 'Loading...' : 'Daftar'}
               </Button>
-- 
cgit v1.2.3


From 6ff5efdb4b7eec25f991f5bfcc02b4a3f883981b Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 11 Sep 2024 10:04:31 +0700
Subject: <iman> update error handling hanya muncul saat button daftar di click

---
 src-migrate/modules/register/index.tsx | 170 ++++++++++++++++++---------------
 1 file changed, 94 insertions(+), 76 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index 31e09088..d91af9e3 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -1,118 +1,130 @@
-import PageContent from "~/modules/page-content";
-import Form from "./components/Form";
-import RegistrasiIndividu from "./components/RegistrasiIndividu";
-import RegistrasiBisnis from "./components/RegistrasiBisnis";
-import FormBisnis from "./components/FormBisnis";
-import Link from "next/link";
-import Image from "next/image";
-import IndoteknikLogo from "~/images/logo.png";
-import AccountActivation from "../account-activation";
-import { useMemo, useState } from "react";
-import { useRegisterStore } from "./stores/useRegisterStore";
-import FormCaptcha from "./components/FormCaptcha";
-import TermCondition from "./components/TermCondition";
-import {  Button } from '@chakra-ui/react'
-import { useMutation } from "react-query";
-import { UseToastOptions, useToast } from "@chakra-ui/react";
-import { RegisterProps } from "~/types/auth";
-import { registerUser } from "~/services/auth";
-import { useRouter } from "next/router";
+import PageContent from '~/modules/page-content';
+import RegistrasiIndividu from './components/RegistrasiIndividu';
+import RegistrasiBisnis from './components/RegistrasiBisnis';
+import Link from 'next/link';
+import Image from 'next/image';
+import IndoteknikLogo from '~/images/logo.png';
+import AccountActivation from '../account-activation';
+import { useMemo, useState } from 'react';
+import { useRegisterStore } from './stores/useRegisterStore';
+import FormCaptcha from './components/FormCaptcha';
+import TermCondition from './components/TermCondition';
+import { Button } from '@chakra-ui/react';
+import { useMutation } from 'react-query';
+import { UseToastOptions, useToast } from '@chakra-ui/react';
+import { RegisterProps } from '~/types/auth';
+import { registerUser } from '~/services/auth';
+import { useRouter } from 'next/router';
 
 const LOGO_WIDTH = 150;
 const LOGO_HEIGHT = LOGO_WIDTH / 3;
 
 const Register = () => {
   const [isIndividuClicked, setIsIndividuClicked] = useState(true);
+  const [notValid, setNotValid] = useState(false);
   const [isBisnisClicked, setIsBisnisClicked] = useState(false);
-  const {form, isCheckedTNC, isValidCaptcha, resetForm,errors,
-    updateForm
-  } = useRegisterStore()
+  const { form, isCheckedTNC, isValidCaptcha, resetForm, errors, updateForm } =
+    useRegisterStore();
 
-  const  isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors])
-  const toast = useToast()
-  const router = useRouter()
+  const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]);
+  const toast = useToast();
+  const router = useRouter();
   const mutation = useMutation({
-    mutationFn: (data: RegisterProps) => registerUser(data)
-  })
+    mutationFn: (data: RegisterProps) => registerUser(data),
+  });
 
   const handleIndividuClick = () => {
     resetForm();
     setIsIndividuClicked(true);
     setIsBisnisClicked(false);
   };
-  
+
   const handleBisnisClick = () => {
     resetForm();
-    updateForm("is_terdaftar", 'false')
-    updateForm("type_acc", 'business')
+    updateForm('is_terdaftar', 'false');
+    updateForm('type_acc', 'business');
     setIsIndividuClicked(false);
     setIsBisnisClicked(true);
   };
   const handleSubmit = async () => {
-    const response = await mutation.mutateAsync(form)
+    if (!isFormValid) {
+      setNotValid(true);
+      return;
+    } else {
+      setNotValid(false);
+    }
+    const response = await mutation.mutateAsync(form);
     if (response?.register === true) {
       const urlParams = new URLSearchParams({
         activation: 'otp',
         email: form.email,
-        redirect: (router.query?.next || '/') as string
-      })
-      router.push(`${router.route}?${urlParams}`)
+        redirect: (router.query?.next || '/') as string,
+      });
+      router.push(`${router.route}?${urlParams}`);
     }
 
     const toastProps: UseToastOptions = {
       duration: 5000,
-      isClosable: true
-    }
+      isClosable: true,
+      position: 'top',
+    };
 
     switch (response?.reason) {
       case 'EMAIL_USED':
         toast({
           ...toastProps,
           title: 'Email sudah digunakan',
-          status: 'warning'
-        })
+          status: 'warning',
+        });
         break;
       case 'NOT_ACTIVE':
-        const activationUrl = `${router.route}?activation=email`
+        const activationUrl = `${router.route}?activation=email`;
         toast({
           ...toastProps,
           title: 'Akun belum aktif',
-          description: <>Akun sudah terdaftar namun belum aktif. <Link href={activationUrl} className="underline">Klik untuk aktivasi akun</Link></>,
-          status: 'warning'
-        })
-        break
+          description: (
+            <>
+              Akun sudah terdaftar namun belum aktif.{' '}
+              <Link href={activationUrl} className='underline'>
+                Klik untuk aktivasi akun
+              </Link>
+            </>
+          ),
+          status: 'warning',
+        });
+        break;
     }
   };
   return (
-    <div className="container">
-      <div className="grid grid-cols-1 md:grid-cols-2 gap-x-8 pt-10 px-2 md:pt-16">
-        <section className="">
-          <div className="px-8 py-4 border">
-            <Link href="/" className="block md:hidden">
+    <div className='container'>
+      <div className='grid grid-cols-1 md:grid-cols-2 gap-x-8 pt-10 px-2 md:pt-16'>
+        <section className=''>
+          <div className='px-8 py-4 border'>
+            <Link href='/' className='block md:hidden'>
               <Image
                 src={IndoteknikLogo}
-                alt="Logo Indoteknik"
+                alt='Logo Indoteknik'
                 width={LOGO_WIDTH}
                 height={LOGO_HEIGHT}
-                className="mx-auto mb-4 w-auto h-auto"
+                className='mx-auto mb-4 w-auto h-auto'
                 priority
               />
             </Link>
 
-            <h1 className="text-2xl font-semibold text-center md:text-left">
+            <h1 className='text-2xl font-semibold text-center md:text-left'>
               Daftar Akun Indoteknik
             </h1>
-            <h2 className="text-gray_r-11 mt-1 mb-4 text-center md:text-left">
+            <h2 className='text-gray_r-11 mt-1 mb-4 text-center md:text-left'>
               Buat akun sekarang lebih mudah dan terverifikasi
             </h2>
 
-            <label htmlFor="name" className="text-black font-bold">
+            <label htmlFor='name' className='text-black font-bold'>
               Tipe Akun
             </label>
-            <div className="grid grid-cols-2 gap-x-3 mt-2 h-14 font-bold text-black hover:cursor-pointer">
+            <div className='grid grid-cols-2 gap-x-3 mt-2 h-14 font-bold text-black hover:cursor-pointer'>
               <div
                 className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
-                  isIndividuClicked ? "bg-red-500 text-white" : ""
+                  isIndividuClicked ? 'bg-red-500 text-white' : ''
                 }`}
                 onClick={handleIndividuClick}
               >
@@ -120,50 +132,56 @@ const Register = () => {
               </div>
               <div
                 className={` border rounded-md flex justify-center items-center transition-colors duration-300 ease-in-out ${
-                  isBisnisClicked ? "bg-red-500 text-white" : ""
+                  isBisnisClicked ? 'bg-red-500 text-white' : ''
                 }`}
                 onClick={handleBisnisClick}
               >
                 <p>Bisnis</p>
               </div>
             </div>
-            <div className="transition-opacity duration-300 ease-in-out">
+            <div className='transition-opacity duration-300 ease-in-out'>
               {isIndividuClicked && (
-                <div className="opacity-100">
-                  <RegistrasiIndividu />
+                <div className='opacity-100'>
+                  <RegistrasiIndividu chekValid={notValid} />
                 </div>
               )}
               {isBisnisClicked && (
-                <div className="opacity-100">
-                  <RegistrasiBisnis />
+                <div className='opacity-100'>
+                  <RegistrasiBisnis chekValid={notValid} />
                 </div>
               )}
             </div>
-            <section className="mt-2">
+            <section className='mt-2'>
               {/* <FormCaptcha /> */}
               <TermCondition />
               <Button
-                type="submit"
-                colorScheme="red"
-                className="w-full mt-2"
+                type='submit'
+                colorScheme='red'
+                className='w-full mt-2'
                 size='lg'
                 onClick={handleSubmit}
-                // isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}  
-                isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading}  
+                // isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}
+                isDisabled={!isCheckedTNC || mutation.isLoading}
               >
                 {mutation.isLoading ? 'Loading...' : 'Daftar'}
               </Button>
             </section>
-            <section className="flex justify-center items-center flex-col">
-              <div className="text-gray_r-11 mt-4 text-center md:text-left">
-                Sudah punya akun Indoteknik?{" "}
-                <Link href="/login" className="inline font-medium text-danger-500">
+            <section className='flex justify-center items-center flex-col'>
+              <div className='text-gray_r-11 mt-4 text-center md:text-left'>
+                Sudah punya akun Indoteknik?{' '}
+                <Link
+                  href='/login'
+                  className='inline font-medium text-danger-500'
+                >
                   Masuk
                 </Link>
               </div>
-              <div className="text-gray_r-11 mt-4 text-center md:text-left">
-                Akun anda belum aktif?{" "}
-                <Link href="/register?activation=email" className="inline font-medium text-danger-500">
+              <div className='text-gray_r-11 mt-4 text-center md:text-left'>
+                Akun anda belum aktif?{' '}
+                <Link
+                  href='/register?activation=email'
+                  className='inline font-medium text-danger-500'
+                >
                   Aktivasi
                 </Link>
               </div>
@@ -171,8 +189,8 @@ const Register = () => {
           </div>
         </section>
 
-        <section className="my-10 md:my-0">
-          <PageContent path="/register" />
+        <section className='my-10 md:my-0'>
+          <PageContent path='/register' />
         </section>
       </div>
 
-- 
cgit v1.2.3


From aaf907c834343970e1d30b3ef49c13ed5f9d34ed Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 17 Sep 2024 09:01:04 +0700
Subject: <iman> add focus error when button submit click

---
 src-migrate/modules/register/index.tsx | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index d91af9e3..08d7f893 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -22,6 +22,7 @@ const LOGO_HEIGHT = LOGO_WIDTH / 3;
 const Register = () => {
   const [isIndividuClicked, setIsIndividuClicked] = useState(true);
   const [notValid, setNotValid] = useState(false);
+  const [buttonSubmitClick, setButtonSubmitClick] = useState(false);
   const [isBisnisClicked, setIsBisnisClicked] = useState(false);
   const { form, isCheckedTNC, isValidCaptcha, resetForm, errors, updateForm } =
     useRegisterStore();
@@ -49,8 +50,10 @@ const Register = () => {
   const handleSubmit = async () => {
     if (!isFormValid) {
       setNotValid(true);
+      setButtonSubmitClick(!buttonSubmitClick);
       return;
     } else {
+      setButtonSubmitClick(!buttonSubmitClick);
       setNotValid(false);
     }
     const response = await mutation.mutateAsync(form);
@@ -142,12 +145,18 @@ const Register = () => {
             <div className='transition-opacity duration-300 ease-in-out'>
               {isIndividuClicked && (
                 <div className='opacity-100'>
-                  <RegistrasiIndividu chekValid={notValid} />
+                  <RegistrasiIndividu
+                    chekValid={notValid}
+                    buttonSubmitClick={buttonSubmitClick}
+                  />
                 </div>
               )}
               {isBisnisClicked && (
                 <div className='opacity-100'>
-                  <RegistrasiBisnis chekValid={notValid} />
+                  <RegistrasiBisnis
+                    chekValid={notValid}
+                    buttonSubmitClick={buttonSubmitClick}
+                  />
                 </div>
               )}
             </div>
-- 
cgit v1.2.3


From 4bd29979c34c1ec3b31dd384829b008eb726769c Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 23 Sep 2024 09:00:51 +0700
Subject: <iman> add valid chapta

---
 src-migrate/modules/register/index.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index 08d7f893..da41fd8b 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -161,7 +161,7 @@ const Register = () => {
               )}
             </div>
             <section className='mt-2'>
-              {/* <FormCaptcha /> */}
+              <FormCaptcha />
               <TermCondition />
               <Button
                 type='submit'
@@ -169,8 +169,9 @@ const Register = () => {
                 className='w-full mt-2'
                 size='lg'
                 onClick={handleSubmit}
-                // isDisabled = {!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha}
-                isDisabled={!isCheckedTNC || mutation.isLoading}
+                isDisabled={
+                  !isCheckedTNC || mutation.isLoading || !isValidCaptcha
+                }
               >
                 {mutation.isLoading ? 'Loading...' : 'Daftar'}
               </Button>
-- 
cgit v1.2.3

