From 92c2a229d9c9b510d71b928978872a8b107e9d5a Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 11 Apr 2023 09:47:25 +0700
Subject: Documentation and refactor code

---
 src/lib/auth/components/Activate.jsx | 52 ++++++++++--------------------------
 1 file changed, 14 insertions(+), 38 deletions(-)

(limited to 'src/lib/auth/components/Activate.jsx')

diff --git a/src/lib/auth/components/Activate.jsx b/src/lib/auth/components/Activate.jsx
index 717e178b..c81bcbbd 100644
--- a/src/lib/auth/components/Activate.jsx
+++ b/src/lib/auth/components/Activate.jsx
@@ -27,10 +27,7 @@ const Activate = () => {
             children: (
               <>
                 Selamat, akun anda berhasil diaktifkan,{' '}
-                <Link
-                  className='text-gray_r-12'
-                  href='/'
-                >
+                <Link className='text-gray_r-12' href='/'>
                   kembali ke beranda
                 </Link>
                 .
@@ -43,10 +40,7 @@ const Activate = () => {
             children: (
               <>
                 Mohon maaf token sudah tidak aktif, lakukan permintaan aktivasi akun kembali atau{' '}
-                <Link
-                  className='text-gray_r-12'
-                  href='/login'
-                >
+                <Link className='text-gray_r-12' href='/login'>
                   masuk
                 </Link>{' '}
                 jika sudah memiliki akun.
@@ -67,9 +61,12 @@ const Activate = () => {
   const activationRequest = async (e) => {
     e.preventDefault()
     setIsLoading(true)
-    let activationRequest = await axios.post(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/activation-request`, {
-      email
-    })
+    let activationRequest = await axios.post(
+      `${process.env.NEXT_PUBLIC_SELF_HOST}/api/activation-request`,
+      {
+        email
+      }
+    )
     if (activationRequest.data.activationRequest) {
       setAlert({
         children: <>Mohon cek email anda untuk aktivasi akun Indoteknik</>,
@@ -82,10 +79,7 @@ const Activate = () => {
             children: (
               <>
                 Email tersebut belum terdaftar,{' '}
-                <Link
-                  className='text-gray_r-12'
-                  href='/register'
-                >
+                <Link className='text-gray_r-12' href='/register'>
                   daftar sekarang
                 </Link>
                 .
@@ -99,10 +93,7 @@ const Activate = () => {
             children: (
               <>
                 Email tersebut sudah terdaftar dan sudah aktif,{' '}
-                <Link
-                  className='text-gray_r-12'
-                  href='/login'
-                >
+                <Link className='text-gray_r-12' href='/login'>
                   masuk sekarang
                 </Link>
                 .
@@ -119,29 +110,18 @@ const Activate = () => {
   return (
     <div className='p-6 pt-10 flex flex-col items-center min-h-screen'>
       <Link href='/'>
-        <Image
-          src={IndoteknikLogo}
-          alt='Logo Indoteknik'
-          width={150}
-          height={50}
-        />
+        <Image src={IndoteknikLogo} alt='Logo Indoteknik' width={150} height={50} />
       </Link>
 
       <h1 className='text-2xl mt-4 font-semibold text-center'>Aktivasi Akun Indoteknik</h1>
 
       {alert && (
-        <Alert
-          className='text-center mt-4'
-          type={alert.type}
-        >
+        <Alert className='text-center mt-4' type={alert.type}>
           {alert.children}
         </Alert>
       )}
 
-      <form
-        onSubmit={activationRequest}
-        className='mt-6 w-full'
-      >
+      <form onSubmit={activationRequest} className='mt-6 w-full'>
         <input
           type='email'
           id='email'
@@ -151,11 +131,7 @@ const Activate = () => {
           placeholder='Masukan alamat email'
           autoFocus
         />
-        <button
-          type='submit'
-          disabled={!email}
-          className='btn-yellow font-semibold mt-4 w-full'
-        >
+        <button type='submit' disabled={!email} className='btn-yellow font-semibold mt-4 w-full'>
           {isLoading ? 'Loading...' : 'Aktivasi'}
         </button>
       </form>
-- 
cgit v1.2.3

