diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-15 09:39:34 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-15 09:39:34 +0700 |
| commit | 2a0933e4dd2230bd76cf09f287dcbeee8ede67e3 (patch) | |
| tree | c366dcc57526a5188222e1db45683dd724722cdc /src | |
| parent | 344fe1857b8307933082110c15b737af9118ac89 (diff) | |
Add quotation, invoice, transaction title and manage profile desktop
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/auth/components/CompanyProfile.jsx | 70 | ||||
| -rw-r--r-- | src/lib/auth/components/Menu.jsx | 3 | ||||
| -rw-r--r-- | src/lib/auth/components/PersonalProfile.jsx | 54 | ||||
| -rw-r--r-- | src/lib/invoice/components/Invoices.jsx | 6 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 4 | ||||
| -rw-r--r-- | src/pages/my/address/[id]/edit.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/address/create.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/address/index.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/invoices/[id].jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/invoices/index.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/profile.jsx | 32 | ||||
| -rw-r--r-- | src/pages/my/quotations/[id].jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/quotations/index.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/transactions/[id].jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/transactions/index.jsx | 3 | ||||
| -rw-r--r-- | src/pages/my/wishlist.jsx | 3 |
16 files changed, 125 insertions, 74 deletions
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> diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 8a8e2e8a..f91fd552 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -29,6 +29,9 @@ const Menu = () => { <LinkItem href='/my/address' active={routeStartWith('/my/address')}> Daftar Alamat </LinkItem> + <LinkItem href='/my/profile' active={routeStartWith('/my/profile')}> + Profil Saya + </LinkItem> <button type='button' className='text-gray_r-12/80 p-2 text-left'> Keluar Akun </button> diff --git a/src/lib/auth/components/PersonalProfile.jsx b/src/lib/auth/components/PersonalProfile.jsx index bca54e24..b9fb3f5f 100644 --- a/src/lib/auth/components/PersonalProfile.jsx +++ b/src/lib/auth/components/PersonalProfile.jsx @@ -38,7 +38,6 @@ const PersonalProfile = () => { if (isUpdated?.user) { setAuth(isUpdated.user) setValue('password', '') - setIsOpen(false) toast.success('Berhasil mengubah profil', { duration: 1500 }) return } @@ -47,46 +46,45 @@ const PersonalProfile = () => { 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 Akun</div> <div className='text-gray_r-11'> Dibawah ini adalah data diri yang anda masukan, periksa kembali data diri 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>Email</label> - <input {...register('email')} type='text' disabled className='form-input mt-3' /> + <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>Email</label> + <input {...register('email')} type='text' disabled className='form-input mt-3' /> + </div> + <div> + <label>Nama Lengkap</label> + <input {...register('name')} type='text' className='form-input mt-3' /> + </div> + <div> + <label>No. Handphone</label> + <input {...register('mobile')} type='tel' className='form-input mt-3' /> + </div> + <div> + <label>Kata Sandi</label> + <input + {...register('password')} + type='password' + className='form-input mt-3' + placeholder='Isi jika ingin mengubah kata sandi' + /> + </div> </div> - <div> - <label>Nama Lengkap</label> - <input {...register('name')} type='text' className='form-input mt-3' /> - </div> - <div> - <label>No. Handphone</label> - <input {...register('mobile')} type='tel' className='form-input mt-3' /> - </div> - <div> - <label>Kata Sandi</label> - <input - {...register('password')} - type='password' - className='form-input mt-3' - placeholder='Isi jika ingin mengubah kata sandi' - /> - </div> - <button type='submit' className='btn-yellow w-full mt-2'> + <button type='submit' className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6'> Simpan </button> </form> diff --git a/src/lib/invoice/components/Invoices.jsx b/src/lib/invoice/components/Invoices.jsx index 96686bbb..5edcfdbf 100644 --- a/src/lib/invoice/components/Invoices.jsx +++ b/src/lib/invoice/components/Invoices.jsx @@ -71,7 +71,7 @@ const Invoices = () => { {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( <Alert type='info' className='text-center'> - Tidak ada data invoice + Tidak ada invoice </Alert> )} @@ -198,7 +198,7 @@ const Invoices = () => { <tbody> {invoices.isLoading && ( <tr> - <td colSpan={5}> + <td colSpan={6}> <div className='flex justify-center my-2'> <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' /> </div> @@ -208,7 +208,7 @@ const Invoices = () => { {!invoices.isLoading && (!invoices?.data?.invoices || invoices?.data?.invoices?.length == 0) && ( <tr> - <td colSpan={6}>Tidak ada data invoice</td> + <td colSpan={6}>Tidak ada invoice</td> </tr> )} {invoices.data?.invoices?.map((invoice) => ( diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index c1c27a51..642881a6 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -83,7 +83,7 @@ const Transactions = ({ context = '' }) => { {!transactions.isLoading && transactions.data?.saleOrders?.length === 0 && ( <Alert type='info' className='text-center'> - Tidak ada data transaksi + Tidak ada transaksi </Alert> )} @@ -246,7 +246,7 @@ const Transactions = ({ context = '' }) => { (!transactions?.data?.saleOrders || transactions?.data?.saleOrders?.length == 0) && ( <tr> - <td colSpan={7}>Tidak ada data transaksi</td> + <td colSpan={7}>Tidak ada transaksi</td> </tr> )} {transactions.data?.saleOrders?.map((saleOrder) => ( diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx index 6706b458..bd680b90 100644 --- a/src/pages/my/address/[id]/edit.jsx +++ b/src/pages/my/address/[id]/edit.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -9,6 +10,8 @@ import IsAuth from '@/lib/auth/components/IsAuth' export default function EditAddress({ id, defaultValues }) { return ( <IsAuth> + <Seo title='Address - Indoteknik.com' /> + <MobileView> <AppLayout title='Ubah Alamat'> <EditAddressComponent id={id} defaultValues={defaultValues} /> diff --git a/src/pages/my/address/create.jsx b/src/pages/my/address/create.jsx index be645853..774e4327 100644 --- a/src/pages/my/address/create.jsx +++ b/src/pages/my/address/create.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -8,6 +9,8 @@ import IsAuth from '@/lib/auth/components/IsAuth' export default function CreateAddress() { return ( <IsAuth> + <Seo title='Address - Indoteknik.com' /> + <MobileView> <AppLayout title='Tambah Alamat'> <CreateAddressComponent /> diff --git a/src/pages/my/address/index.jsx b/src/pages/my/address/index.jsx index 61d72a41..bd8b3ac3 100644 --- a/src/pages/my/address/index.jsx +++ b/src/pages/my/address/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -8,6 +9,8 @@ import IsAuth from '@/lib/auth/components/IsAuth' export default function Addresses() { return ( <IsAuth> + <Seo title='Address - Indoteknik.com' /> + <MobileView> <AppLayout title='Daftar Alamat'> <AddressesComponent /> diff --git a/src/pages/my/invoices/[id].jsx b/src/pages/my/invoices/[id].jsx index 5972b382..c8f39acf 100644 --- a/src/pages/my/invoices/[id].jsx +++ b/src/pages/my/invoices/[id].jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -11,6 +12,8 @@ export default function MyInvoice() { return ( <IsAuth> + <Seo title='Invoice - Indoteknik.com' /> + <MobileView> <AppLayout title='Invoice & Faktur Pajak'> <InvoiceComponent id={router.query.id} /> diff --git a/src/pages/my/invoices/index.jsx b/src/pages/my/invoices/index.jsx index 73c7b9fe..a2eeceaa 100644 --- a/src/pages/my/invoices/index.jsx +++ b/src/pages/my/invoices/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -8,6 +9,8 @@ import InvoicesComponent from '@/lib/invoice/components/Invoices' export default function MyInvoices() { return ( <IsAuth> + <Seo title='Invoices - Indoteknik.com' /> + <MobileView> <AppLayout title='Invoice & Faktur Pajak'> <InvoicesComponent /> diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 72a1ee3c..25c3a608 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -1,19 +1,41 @@ import Divider from '@/core/components/elements/Divider/Divider' import AppLayout from '@/core/components/layouts/AppLayout' +import BasicLayout from '@/core/components/layouts/BasicLayout' +import DesktopView from '@/core/components/views/DesktopView' +import MobileView from '@/core/components/views/MobileView' import useAuth from '@/core/hooks/useAuth' import CompanyProfile from '@/lib/auth/components/CompanyProfile' import IsAuth from '@/lib/auth/components/IsAuth' +import Menu from '@/lib/auth/components/Menu' import PersonalProfile from '@/lib/auth/components/PersonalProfile' export default function Profile() { const auth = useAuth() return ( <IsAuth> - <AppLayout title='Akun Saya'> - <PersonalProfile /> - <Divider /> - {auth?.parentId && <CompanyProfile />} - </AppLayout> + <MobileView> + <AppLayout title='Akun Saya'> + <PersonalProfile /> + <Divider /> + {auth?.parentId && <CompanyProfile />} + </AppLayout> + </MobileView> + + <DesktopView> + <BasicLayout> + <div className='container mx-auto flex py-10'> + <div className='w-3/12 pr-4'> + <Menu /> + </div> + <div className='w-9/12 bg-white border border-gray_r-6 rounded'> + <PersonalProfile /> + <Divider /> + {auth?.parentId && <CompanyProfile />} + + </div> + </div> + </BasicLayout> + </DesktopView> </IsAuth> ) } diff --git a/src/pages/my/quotations/[id].jsx b/src/pages/my/quotations/[id].jsx index 1fbbf34a..3ddf939d 100644 --- a/src/pages/my/quotations/[id].jsx +++ b/src/pages/my/quotations/[id].jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -11,6 +12,8 @@ export default function MyQuotation() { return ( <IsAuth> + <Seo title='Quotation - Indoteknik.com' /> + <MobileView> <AppLayout title='Transaksi'> <TransactionComponent id={router.query.id} /> diff --git a/src/pages/my/quotations/index.jsx b/src/pages/my/quotations/index.jsx index bd91d9d0..f850de76 100644 --- a/src/pages/my/quotations/index.jsx +++ b/src/pages/my/quotations/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -10,6 +11,8 @@ const TransactionsComponent = dynamic(() => import('@/lib/transaction/components export default function MyQuotations() { return ( <IsAuth> + <Seo title='Quotations - Indoteknik.com' /> + <MobileView> <AppLayout title='Quotation'> <TransactionsComponent context='quotation' /> diff --git a/src/pages/my/transactions/[id].jsx b/src/pages/my/transactions/[id].jsx index e36c1ca4..31c2cd63 100644 --- a/src/pages/my/transactions/[id].jsx +++ b/src/pages/my/transactions/[id].jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -11,6 +12,8 @@ export default function MyTransaction() { return ( <IsAuth> + <Seo title='Transaction - Indoteknik.com' /> + <MobileView> <AppLayout title='Transaksi'> <TransactionComponent id={router.query.id} /> diff --git a/src/pages/my/transactions/index.jsx b/src/pages/my/transactions/index.jsx index 91482a39..c1fb9a67 100644 --- a/src/pages/my/transactions/index.jsx +++ b/src/pages/my/transactions/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -10,6 +11,8 @@ const TransactionsComponent = dynamic(() => import('@/lib/transaction/components export default function MyTransactions() { return ( <IsAuth> + <Seo title='Transactions - Indoteknik.com' /> + <MobileView> <AppLayout title='Transaksi'> <TransactionsComponent /> diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx index 7d9ad0d7..52b70ae2 100644 --- a/src/pages/my/wishlist.jsx +++ b/src/pages/my/wishlist.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -8,6 +9,8 @@ import Wishlists from '@/lib/wishlist/components/Wishlists' export default function Wishlist() { return ( <IsAuth> + <Seo title='Wishlist - Indoteknik.com' /> + <MobileView> <AppLayout title='Wishlist'> <Wishlists /> |
