summaryrefslogtreecommitdiff
path: root/src/pages/my
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-22 11:03:34 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-22 11:03:34 +0700
commitf66b12fd1d0b83af0d7230d7b1565fbe00afbe3c (patch)
tree253dcf854a3c92e09ca846e86a09e5b4c5d16be1 /src/pages/my
parent3c559031623649a67825ff47f34512f0eb946861 (diff)
prettier
Diffstat (limited to 'src/pages/my')
-rw-r--r--src/pages/my/address/[id]/edit.jsx18
-rw-r--r--src/pages/my/address/create.jsx8
-rw-r--r--src/pages/my/address/index.jsx8
-rw-r--r--src/pages/my/invoice/[id].jsx10
-rw-r--r--src/pages/my/invoices.jsx8
-rw-r--r--src/pages/my/menu.jsx103
-rw-r--r--src/pages/my/transaction/[id].jsx10
-rw-r--r--src/pages/my/transactions.jsx10
-rw-r--r--src/pages/my/wishlist.jsx8
9 files changed, 80 insertions, 103 deletions
diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx
index feff85fd..a7c22147 100644
--- a/src/pages/my/address/[id]/edit.jsx
+++ b/src/pages/my/address/[id]/edit.jsx
@@ -1,10 +1,10 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import addressApi from "@/lib/address/api/addressApi"
-import EditAddressComponent from "@/lib/address/components/EditAddress"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import addressApi from '@/lib/address/api/addressApi'
+import EditAddressComponent from '@/lib/address/components/EditAddress'
export default function EditAddress({ id, defaultValues }) {
return (
- <AppLayout title="Ubah Alamat">
+ <AppLayout title='Ubah Alamat'>
<EditAddressComponent id={id} defaultValues={defaultValues} />
</AppLayout>
)
@@ -20,11 +20,11 @@ export async function getServerSideProps(context) {
mobile: address.mobile,
street: address.street,
zip: address.zip,
- city: address.city?.id || "",
- oldDistrict: address.district?.id || "",
- district: "",
- oldSubDistrict: address.subDistrict?.id || "",
- subDistrict: "",
+ city: address.city?.id || '',
+ oldDistrict: address.district?.id || '',
+ district: '',
+ oldSubDistrict: address.subDistrict?.id || '',
+ subDistrict: ''
}
return { props: { id, defaultValues } }
}
diff --git a/src/pages/my/address/create.jsx b/src/pages/my/address/create.jsx
index dfc84444..ee905ee0 100644
--- a/src/pages/my/address/create.jsx
+++ b/src/pages/my/address/create.jsx
@@ -1,10 +1,10 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import CreateAddressComponent from "@/lib/address/components/CreateAddress"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import CreateAddressComponent from '@/lib/address/components/CreateAddress'
export default function CreateAddress() {
return (
- <AppLayout title="Tambah Alamat">
+ <AppLayout title='Tambah Alamat'>
<CreateAddressComponent />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/address/index.jsx b/src/pages/my/address/index.jsx
index 29e21c30..46a7075c 100644
--- a/src/pages/my/address/index.jsx
+++ b/src/pages/my/address/index.jsx
@@ -1,10 +1,10 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import AddressesComponent from "@/lib/address/components/Addresses"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import AddressesComponent from '@/lib/address/components/Addresses'
export default function Addresses() {
return (
- <AppLayout title="Daftar Alamat">
+ <AppLayout title='Daftar Alamat'>
<AddressesComponent />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/invoice/[id].jsx b/src/pages/my/invoice/[id].jsx
index a3cbeb5c..0d409878 100644
--- a/src/pages/my/invoice/[id].jsx
+++ b/src/pages/my/invoice/[id].jsx
@@ -1,13 +1,13 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import InvoiceComponent from "@/lib/invoice/components/Invoice"
-import { useRouter } from "next/router"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import InvoiceComponent from '@/lib/invoice/components/Invoice'
+import { useRouter } from 'next/router'
export default function Invoice() {
const router = useRouter()
return (
- <AppLayout title="Invoice & Faktur Pajak">
+ <AppLayout title='Invoice & Faktur Pajak'>
<InvoiceComponent id={router.query.id} />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/invoices.jsx b/src/pages/my/invoices.jsx
index 04842110..fd50c3c8 100644
--- a/src/pages/my/invoices.jsx
+++ b/src/pages/my/invoices.jsx
@@ -1,10 +1,10 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import InvoicesComponent from "@/lib/invoice/components/Invoices"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import InvoicesComponent from '@/lib/invoice/components/Invoices'
export default function Invoices() {
return (
- <AppLayout title="Invoice & Faktur Pajak">
+ <AppLayout title='Invoice & Faktur Pajak'>
<InvoicesComponent />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index 3620fc36..0edc98ae 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -1,10 +1,10 @@
-import Divider from "@/core/components/elements/Divider/Divider"
-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 { ChevronRightIcon, UserIcon } from "@heroicons/react/24/solid"
-import { useRouter } from "next/router"
+import Divider from '@/core/components/elements/Divider/Divider'
+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 { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'
+import { useRouter } from 'next/router'
export default function Menu() {
const auth = useAuth()
@@ -12,78 +12,56 @@ export default function Menu() {
const logout = () => {
deleteAuth()
- router.push('/login')
+ router.push('/login')
}
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" />
+ <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 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 className='ml-auto !text-gray_r-12'>
+ <ChevronRightIcon className='w-6' />
</div>
</Link>
<Divider />
- <div className="flex flex-col gap-y-6 py-6">
+ <div className='flex flex-col gap-y-6 py-6'>
<div>
- <MenuHeader>
- Aktivitas Pembelian
- </MenuHeader>
+ <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>
- <MenuHeader>
- Pusat Bantuan
- </MenuHeader>
+ <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>
- <MenuHeader>
- Pengaturan Akun
- </MenuHeader>
+ <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 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>
@@ -92,17 +70,16 @@ export default function Menu() {
}
const MenuHeader = ({ children, ...props }) => (
- <div {...props} className="font-medium px-4 flex">
- { children }
-
+ <div {...props} className='font-medium px-4 flex'>
+ {children}
</div>
)
const LinkItem = ({ children, ...props }) => (
- <Link {...props} className="!text-gray_r-11 !font-normal p-4 flex items-center">
- { children }
- <div className="ml-auto !text-gray_r-11">
- <ChevronRightIcon className="w-5" />
+ <Link {...props} className='!text-gray_r-11 !font-normal p-4 flex items-center'>
+ {children}
+ <div className='ml-auto !text-gray_r-11'>
+ <ChevronRightIcon className='w-5' />
</div>
</Link>
-) \ No newline at end of file
+)
diff --git a/src/pages/my/transaction/[id].jsx b/src/pages/my/transaction/[id].jsx
index 4b81b2a3..ae27ab88 100644
--- a/src/pages/my/transaction/[id].jsx
+++ b/src/pages/my/transaction/[id].jsx
@@ -1,13 +1,13 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import TransactionComponent from "@/lib/transaction/components/Transaction"
-import { useRouter } from "next/router"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import TransactionComponent from '@/lib/transaction/components/Transaction'
+import { useRouter } from 'next/router'
export default function Transaction() {
const router = useRouter()
return (
- <AppLayout title="Transaksi">
+ <AppLayout title='Transaksi'>
<TransactionComponent id={router.query.id} />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/transactions.jsx b/src/pages/my/transactions.jsx
index a530afcc..d18a00f4 100644
--- a/src/pages/my/transactions.jsx
+++ b/src/pages/my/transactions.jsx
@@ -1,12 +1,12 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import dynamic from "next/dynamic"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import dynamic from 'next/dynamic'
-const TransactionsComponent = dynamic(() => import("@/lib/transaction/components/Transactions"))
+const TransactionsComponent = dynamic(() => import('@/lib/transaction/components/Transactions'))
export default function Transactions() {
return (
- <AppLayout title="Transaksi">
+ <AppLayout title='Transaksi'>
<TransactionsComponent />
</AppLayout>
)
-} \ No newline at end of file
+}
diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx
index b7a3e4fe..f1c0bf28 100644
--- a/src/pages/my/wishlist.jsx
+++ b/src/pages/my/wishlist.jsx
@@ -1,10 +1,10 @@
-import AppLayout from "@/core/components/layouts/AppLayout"
-import Wishlists from "@/lib/wishlist/components/Wishlists"
+import AppLayout from '@/core/components/layouts/AppLayout'
+import Wishlists from '@/lib/wishlist/components/Wishlists'
export default function Wishlist() {
return (
- <AppLayout title="Wishlist">
+ <AppLayout title='Wishlist'>
<Wishlists />
</AppLayout>
)
-} \ No newline at end of file
+}