From 2a0933e4dd2230bd76cf09f287dcbeee8ede67e3 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 15 May 2023 09:39:34 +0700
Subject: Add quotation, invoice, transaction title and manage profile desktop

---
 src/lib/auth/components/CompanyProfile.jsx | 70 +++++++++++++++---------------
 1 file changed, 34 insertions(+), 36 deletions(-)

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

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index 13d4a194..ff673953 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -60,7 +60,6 @@ const CompanyProfile = () => {
     }
     const isUpdated = await odooApi('PUT', `/api/v1/partner/${auth.parentId}`, data)
     if (isUpdated?.id) {
-      setIsOpen(false)
       toast.success('Berhasil mengubah profil', { duration: 1500 })
       return
     }
@@ -69,59 +68,58 @@ const CompanyProfile = () => {
 
   return (
     <>
-      <button type='button' onClick={toggle} className='p-4 flex items-center text-left'>
+      <button type='button' onClick={toggle} className='p-4 flex items-center text-left w-full'>
         <div>
           <div className='font-semibold mb-2'>Informasi Usaha</div>
           <div className='text-gray_r-11'>
             Dibawah ini adalah data usaha yang anda masukkan, periksa kembali data usaha anda.
           </div>
         </div>
-        <div className='ml-2 p-2 bg-gray_r-3 rounded'>
+        <div className='ml-auto p-2 bg-gray_r-3 rounded'>
           {!isOpen && <ChevronDownIcon className='w-6' />}
           {isOpen && <ChevronUpIcon className='w-6' />}
         </div>
       </button>
 
       {isOpen && (
-        <form
-          className='p-4 border-t border-gray_r-6 flex flex-col gap-y-4'
-          onSubmit={handleSubmit(onSubmitHandler)}
-        >
-          <div>
-            <label className='block mb-3'>Klasifikasi Jenis Usaha</label>
-            <Controller
-              name='industry'
-              control={control}
-              render={(props) => <HookFormSelect {...props} options={industries} />}
-            />
-          </div>
-          <div className='flex flex-wrap'>
-            <div className='w-full mb-3'>Nama Usaha</div>
-            <div className='w-3/12 pr-1'>
+        <form className='p-4 border-t border-gray_r-6' onSubmit={handleSubmit(onSubmitHandler)}>
+          <div className='grid grid-cols-1 sm:grid-cols-2 gap-4'>
+            <div>
+              <label className='block mb-3'>Klasifikasi Jenis Usaha</label>
               <Controller
-                name='companyType'
+                name='industry'
                 control={control}
-                render={(props) => <HookFormSelect {...props} options={companyTypes} />}
+                render={(props) => <HookFormSelect {...props} options={industries} />}
               />
             </div>
-            <div className='w-9/12 pl-1'>
-              <input
-                {...register('name')}
-                type='text'
-                className='form-input'
-                placeholder='Cth: Indoteknik Dotcom Gemilang'
-              />
+            <div className='flex flex-wrap'>
+              <div className='w-full mb-3'>Nama Usaha</div>
+              <div className='w-3/12 pr-1'>
+                <Controller
+                  name='companyType'
+                  control={control}
+                  render={(props) => <HookFormSelect {...props} options={companyTypes} />}
+                />
+              </div>
+              <div className='w-9/12 pl-1'>
+                <input
+                  {...register('name')}
+                  type='text'
+                  className='form-input'
+                  placeholder='Cth: Indoteknik Dotcom Gemilang'
+                />
+              </div>
+            </div>
+            <div>
+              <label>Nama Wajib Pajak</label>
+              <input {...register('taxName')} type='text' className='form-input mt-3' />
+            </div>
+            <div>
+              <label>Nomor NPWP</label>
+              <input {...register('npwp')} type='text' className='form-input mt-3' />
             </div>
           </div>
-          <div>
-            <label>Nama Wajib Pajak</label>
-            <input {...register('taxName')} type='text' className='form-input mt-3' />
-          </div>
-          <div>
-            <label>Nomor NPWP</label>
-            <input {...register('npwp')} type='text' className='form-input mt-3' />
-          </div>
-          <button type='submit' className='btn-yellow w-full mt-2'>
+          <button type='submit' className='btn-yellow w-full mt-6'>
             Simpan
           </button>
         </form>
-- 
cgit v1.2.3

