From 90710579ba1c12060877f6ec2d26103f9c31058d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 23 Oct 2023 17:11:33 +0700
Subject: Refactor and migrate register page

---
 .../modules/register/components/TermCondition.tsx        | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 src-migrate/modules/register/components/TermCondition.tsx

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

diff --git a/src-migrate/modules/register/components/TermCondition.tsx b/src-migrate/modules/register/components/TermCondition.tsx
new file mode 100644
index 00000000..304ffd69
--- /dev/null
+++ b/src-migrate/modules/register/components/TermCondition.tsx
@@ -0,0 +1,16 @@
+import React from 'react'
+import Modal from '~/common/components/elements/Modal'
+import { useRegisterStore } from '~/common/stores/useRegisterStore'
+import PageContent from '~/modules/page-content'
+
+const TermCondition = () => {
+  const { isOpenTNC, closeTNC } = useRegisterStore()
+
+  return (
+    <Modal active={isOpenTNC} close={closeTNC} >
+      <PageContent path='/register#tnd' />
+    </Modal>
+  )
+}
+
+export default TermCondition
\ No newline at end of file
-- 
cgit v1.2.3


From cf6da809621b4ebe8c9acedb035b689e7e1b60b1 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 25 Oct 2023 17:27:32 +0700
Subject: Update register page

---
 .../modules/register/components/TermCondition.tsx  | 26 ++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

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

diff --git a/src-migrate/modules/register/components/TermCondition.tsx b/src-migrate/modules/register/components/TermCondition.tsx
index 304ffd69..aaba6604 100644
--- a/src-migrate/modules/register/components/TermCondition.tsx
+++ b/src-migrate/modules/register/components/TermCondition.tsx
@@ -1,15 +1,33 @@
+import { Checkbox } from '@chakra-ui/react'
 import React from 'react'
 import Modal from '~/common/components/elements/Modal'
 import { useRegisterStore } from '~/common/stores/useRegisterStore'
 import PageContent from '~/modules/page-content'
 
 const TermCondition = () => {
-  const { isOpenTNC, closeTNC } = useRegisterStore()
+  const { isOpenTNC, closeTNC, isCheckedTNC, toggleCheckTNC, openTNC } = useRegisterStore()
 
   return (
-    <Modal active={isOpenTNC} close={closeTNC} >
-      <PageContent path='/register#tnd' />
-    </Modal>
+    <>
+      <div className="mt-4 flex items-center gap-x-2">
+        <Checkbox id='tnc' name='tnc' checked={isCheckedTNC} onChange={toggleCheckTNC} />
+        <div>
+          <label htmlFor="tnc" className="cursor-pointer">Dengan ini saya menyetujui</label>
+          {' '}
+          <span
+            className="font-medium text-danger-500 cursor-pointer"
+            onClick={openTNC}
+          >
+            syarat dan ketentuan
+          </span>
+          <label htmlFor="tnc" className="ml-2 cursor-pointer">yang berlaku</label>
+        </div>
+      </div>
+
+      <Modal active={isOpenTNC} close={closeTNC} >
+        <PageContent path='/register#tnd' />
+      </Modal>
+    </>
   )
 }
 
-- 
cgit v1.2.3


From 5a9210e560ca47d8f4d8c43b06fc93d1d064a6f6 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 10 Nov 2023 16:23:33 +0700
Subject: Add close on modal otp activation, change validation register schema,
 fix term and condition checkbox

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

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

diff --git a/src-migrate/modules/register/components/TermCondition.tsx b/src-migrate/modules/register/components/TermCondition.tsx
index aaba6604..6b95ba19 100644
--- a/src-migrate/modules/register/components/TermCondition.tsx
+++ b/src-migrate/modules/register/components/TermCondition.tsx
@@ -10,7 +10,7 @@ const TermCondition = () => {
   return (
     <>
       <div className="mt-4 flex items-center gap-x-2">
-        <Checkbox id='tnc' name='tnc' checked={isCheckedTNC} onChange={toggleCheckTNC} />
+        <Checkbox id='tnc' name='tnc' isChecked={isCheckedTNC} onChange={toggleCheckTNC} />
         <div>
           <label htmlFor="tnc" className="cursor-pointer">Dengan ini saya menyetujui</label>
           {' '}
-- 
cgit v1.2.3

