diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-27 10:49:45 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-27 10:49:45 +0700 |
| commit | ffa261e6adef70a2845878cf93e6e492eb8cee62 (patch) | |
| tree | c860ac8d127795ee813af59923305736596264c2 /src/pages | |
| parent | 14ad96a9d010790fe7a482035d6d88f36db660fe (diff) | |
footer
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/my/address/[id]/edit.jsx | 15 | ||||
| -rw-r--r-- | src/pages/my/address/create.jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/address/index.jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/invoice/[id].jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/invoices.jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/menu.jsx | 91 | ||||
| -rw-r--r-- | src/pages/my/profile.jsx | 13 | ||||
| -rw-r--r-- | src/pages/my/transaction/[id].jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/transactions.jsx | 9 | ||||
| -rw-r--r-- | src/pages/my/wishlist.jsx | 9 | ||||
| -rw-r--r-- | src/pages/shop/checkout/finish.jsx | 9 | ||||
| -rw-r--r-- | src/pages/shop/checkout/index.jsx | 9 | ||||
| -rw-r--r-- | src/pages/shop/quotation/finish.jsx | 59 | ||||
| -rw-r--r-- | src/pages/shop/quotation/index.jsx | 9 |
14 files changed, 155 insertions, 113 deletions
diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx index 65d7cf9b..bc5f3471 100644 --- a/src/pages/my/address/[id]/edit.jsx +++ b/src/pages/my/address/[id]/edit.jsx @@ -1,15 +1,18 @@ import AppLayout from '@/core/components/layouts/AppLayout' import addressApi from '@/lib/address/api/addressApi' import EditAddressComponent from '@/lib/address/components/EditAddress' +import IsAuth from '@/lib/auth/components/IsAuth' export default function EditAddress({ id, defaultValues }) { return ( - <AppLayout title='Ubah Alamat'> - <EditAddressComponent - id={id} - defaultValues={defaultValues} - /> - </AppLayout> + <IsAuth> + <AppLayout title='Ubah Alamat'> + <EditAddressComponent + id={id} + defaultValues={defaultValues} + /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/address/create.jsx b/src/pages/my/address/create.jsx index ee905ee0..ec17f987 100644 --- a/src/pages/my/address/create.jsx +++ b/src/pages/my/address/create.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' import CreateAddressComponent from '@/lib/address/components/CreateAddress' +import IsAuth from '@/lib/auth/components/IsAuth' export default function CreateAddress() { return ( - <AppLayout title='Tambah Alamat'> - <CreateAddressComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Tambah Alamat'> + <CreateAddressComponent /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/address/index.jsx b/src/pages/my/address/index.jsx index 46a7075c..93ed40b0 100644 --- a/src/pages/my/address/index.jsx +++ b/src/pages/my/address/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' import AddressesComponent from '@/lib/address/components/Addresses' +import IsAuth from '@/lib/auth/components/IsAuth' export default function Addresses() { return ( - <AppLayout title='Daftar Alamat'> - <AddressesComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Daftar Alamat'> + <AddressesComponent /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/invoice/[id].jsx b/src/pages/my/invoice/[id].jsx index 0d409878..4938d8f8 100644 --- a/src/pages/my/invoice/[id].jsx +++ b/src/pages/my/invoice/[id].jsx @@ -1,4 +1,5 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import InvoiceComponent from '@/lib/invoice/components/Invoice' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Invoice() { const router = useRouter() return ( - <AppLayout title='Invoice & Faktur Pajak'> - <InvoiceComponent id={router.query.id} /> - </AppLayout> + <IsAuth> + <AppLayout title='Invoice & Faktur Pajak'> + <InvoiceComponent id={router.query.id} /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/invoices.jsx b/src/pages/my/invoices.jsx index fd50c3c8..12a5ff7e 100644 --- a/src/pages/my/invoices.jsx +++ b/src/pages/my/invoices.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import InvoicesComponent from '@/lib/invoice/components/Invoices' export default function Invoices() { return ( - <AppLayout title='Invoice & Faktur Pajak'> - <InvoicesComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Invoice & Faktur Pajak'> + <InvoicesComponent /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 576919ae..40c84668 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -3,6 +3,7 @@ import Link from '@/core/components/elements/Link/Link' import AppLayout from '@/core/components/layouts/AppLayout' import useAuth from '@/core/hooks/useAuth' import { deleteAuth } from '@/core/utils/auth' +import IsAuth from '@/lib/auth/components/IsAuth' import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' import { useRouter } from 'next/router' @@ -16,62 +17,64 @@ export default function Menu() { } return ( - <AppLayout title='Menu Utama'> - <Link - href='/my/profile' - className='p-4 flex items-center' - > - <div className='rounded-full p-3 bg-gray_r-6 text-gray_r-12/80'> - <UserIcon className='w-5' /> - </div> - <div className='ml-4'> - <div className='font-semibold text-gray_r-12'>{auth?.name}</div> - {auth?.company && <div className='badge-solid-red mt-1'>Akun Bisnis</div>} - {!auth?.company && <div className='badge-gray mt-1'>Akun Individu</div>} - </div> - <div className='ml-auto !text-gray_r-12'> - <ChevronRightIcon className='w-6' /> - </div> - </Link> + <IsAuth> + <AppLayout title='Menu Utama'> + <Link + href='/my/profile' + className='p-4 flex items-center' + > + <div className='rounded-full p-3 bg-gray_r-6 text-gray_r-12/80'> + <UserIcon className='w-5' /> + </div> + <div className='ml-4'> + <div className='font-semibold text-gray_r-12'>{auth?.name}</div> + {auth?.company && <div className='badge-solid-red mt-1'>Akun Bisnis</div>} + {!auth?.company && <div className='badge-gray mt-1'>Akun Individu</div>} + </div> + <div className='ml-auto !text-gray_r-12'> + <ChevronRightIcon className='w-6' /> + </div> + </Link> - <Divider /> + <Divider /> - <div className='flex flex-col gap-y-6 py-6'> - <div> - <MenuHeader>Aktivitas Pembelian</MenuHeader> + <div className='flex flex-col gap-y-6 py-6'> + <div> + <MenuHeader>Aktivitas Pembelian</MenuHeader> - <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> - <LinkItem href='/my/transactions'>Daftar Transaksi</LinkItem> - <LinkItem href='/my/invoices'>Invoice & Faktur Pajak</LinkItem> - <LinkItem href='/my/wishlist'>Wishlist</LinkItem> + <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> + <LinkItem href='/my/transactions'>Daftar Transaksi</LinkItem> + <LinkItem href='/my/invoices'>Invoice & Faktur Pajak</LinkItem> + <LinkItem href='/my/wishlist'>Wishlist</LinkItem> + </div> </div> - </div> - <div> - <MenuHeader>Pusat Bantuan</MenuHeader> + <div> + <MenuHeader>Pusat Bantuan</MenuHeader> - <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> - <LinkItem href='/'>Customer Support</LinkItem> - <LinkItem href='/'>F.A.Q</LinkItem> + <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> + <LinkItem href='/'>Customer Support</LinkItem> + <LinkItem href='/'>F.A.Q</LinkItem> + </div> </div> - </div> - <div> - <MenuHeader>Pengaturan Akun</MenuHeader> + <div> + <MenuHeader>Pengaturan Akun</MenuHeader> - <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> - <LinkItem href='/my/address'>Daftar Alamat</LinkItem> - </div> + <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'> + <LinkItem href='/my/address'>Daftar Alamat</LinkItem> + </div> - <div - onClick={logout} - className='p-4 mt-2' - > - <button className='w-full btn-red'>Keluar Akun</button> + <div + onClick={logout} + className='p-4 mt-2' + > + <button className='w-full btn-red'>Keluar Akun</button> + </div> </div> </div> - </div> - </AppLayout> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 8a91ea17..72a1ee3c 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -2,15 +2,18 @@ import Divider from '@/core/components/elements/Divider/Divider' import AppLayout from '@/core/components/layouts/AppLayout' import useAuth from '@/core/hooks/useAuth' import CompanyProfile from '@/lib/auth/components/CompanyProfile' +import IsAuth from '@/lib/auth/components/IsAuth' import PersonalProfile from '@/lib/auth/components/PersonalProfile' export default function Profile() { const auth = useAuth() return ( - <AppLayout title='Akun Saya'> - <PersonalProfile /> - <Divider /> - {auth?.parentId && <CompanyProfile />} - </AppLayout> + <IsAuth> + <AppLayout title='Akun Saya'> + <PersonalProfile /> + <Divider /> + {auth?.parentId && <CompanyProfile />} + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/transaction/[id].jsx b/src/pages/my/transaction/[id].jsx index ae27ab88..5167748c 100644 --- a/src/pages/my/transaction/[id].jsx +++ b/src/pages/my/transaction/[id].jsx @@ -1,4 +1,5 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import TransactionComponent from '@/lib/transaction/components/Transaction' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Transaction() { const router = useRouter() return ( - <AppLayout title='Transaksi'> - <TransactionComponent id={router.query.id} /> - </AppLayout> + <IsAuth> + <AppLayout title='Transaksi'> + <TransactionComponent id={router.query.id} /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/transactions.jsx b/src/pages/my/transactions.jsx index d18a00f4..30b9be07 100644 --- a/src/pages/my/transactions.jsx +++ b/src/pages/my/transactions.jsx @@ -1,12 +1,15 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import dynamic from 'next/dynamic' const TransactionsComponent = dynamic(() => import('@/lib/transaction/components/Transactions')) export default function Transactions() { return ( - <AppLayout title='Transaksi'> - <TransactionsComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Transaksi'> + <TransactionsComponent /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx index f1c0bf28..196adf50 100644 --- a/src/pages/my/wishlist.jsx +++ b/src/pages/my/wishlist.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import Wishlists from '@/lib/wishlist/components/Wishlists' export default function Wishlist() { return ( - <AppLayout title='Wishlist'> - <Wishlists /> - </AppLayout> + <IsAuth> + <AppLayout title='Wishlist'> + <Wishlists /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/shop/checkout/finish.jsx b/src/pages/shop/checkout/finish.jsx index fb6970f6..cc64199f 100644 --- a/src/pages/shop/checkout/finish.jsx +++ b/src/pages/shop/checkout/finish.jsx @@ -1,4 +1,5 @@ import BasicLayout from '@/core/components/layouts/BasicLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Finish() { const router = useRouter() return ( - <BasicLayout> - <FinishCheckoutComponent id={router.query.id || 0} /> - </BasicLayout> + <IsAuth> + <BasicLayout> + <FinishCheckoutComponent id={router.query.id || 0} /> + </BasicLayout> + </IsAuth> ) } diff --git a/src/pages/shop/checkout/index.jsx b/src/pages/shop/checkout/index.jsx index 5e8f2663..015a11b3 100644 --- a/src/pages/shop/checkout/index.jsx +++ b/src/pages/shop/checkout/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import CheckoutComponent from '@/lib/checkout/components/Checkout' export default function Checkout() { return ( - <AppLayout title='Checkout'> - <CheckoutComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Checkout'> + <CheckoutComponent /> + </AppLayout> + </IsAuth> ) } diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 98ffeec2..15881ea0 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -1,6 +1,7 @@ import Link from '@/core/components/elements/Link/Link' import BasicLayout from '@/core/components/layouts/BasicLayout' import useAuth from '@/core/hooks/useAuth' +import IsAuth from '@/lib/auth/components/IsAuth' import { EnvelopeIcon } from '@heroicons/react/24/outline' import { useRouter } from 'next/router' @@ -9,33 +10,35 @@ export default function FinishQuotation() { const router = useRouter() const { id } = router.query return ( - <BasicLayout> - <div className='m-4 px-4 py-6 shadow-md border border-gray_r-3'> - <div className='flex'> - <span className='p-3 mx-auto bg-yellow_r-3 border border-yellow_r-6 rounded'> - <EnvelopeIcon className='w-8 text-yellow_r-11' /> - </span> - </div> - <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p> - <p className='text-center mt-3 leading-6 text-gray_r-11'> - Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera menghubungi - anda. - </p> - {id && ( - <Link - href={`/my/transaction/${id}`} - className='btn-yellow !text-gray_r-12 mt-6 w-full' - > - Lihat Penawaran - </Link> - )} - <Link - href='/' - className='btn-light !text-gray_r-12 mt-2 w-full' - > - Ke Halaman Utama - </Link> - </div> - </BasicLayout> + <IsAuth> + <BasicLayout> + <div className='m-4 px-4 py-6 shadow-md border border-gray_r-3'> + <div className='flex'> + <span className='p-3 mx-auto bg-yellow_r-3 border border-yellow_r-6 rounded'> + <EnvelopeIcon className='w-8 text-yellow_r-11' /> + </span> + </div> + <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p> + <p className='text-center mt-3 leading-6 text-gray_r-11'> + Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera + menghubungi anda. + </p> + {id && ( + <Link + href={`/my/transaction/${id}`} + className='btn-yellow !text-gray_r-12 mt-6 w-full' + > + Lihat Penawaran + </Link> + )} + <Link + href='/' + className='btn-light !text-gray_r-12 mt-2 w-full' + > + Ke Halaman Utama + </Link> + </div> + </BasicLayout> + </IsAuth> ) } diff --git a/src/pages/shop/quotation/index.jsx b/src/pages/shop/quotation/index.jsx index 744b75fe..ff8b8644 100644 --- a/src/pages/shop/quotation/index.jsx +++ b/src/pages/shop/quotation/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import QuotationComponent from '@/lib/quotation/components/Quotation' export default function Quotation() { return ( - <AppLayout title='Quotation'> - <QuotationComponent /> - </AppLayout> + <IsAuth> + <AppLayout title='Quotation'> + <QuotationComponent /> + </AppLayout> + </IsAuth> ) } |
