From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 17 Feb 2023 17:07:50 +0700 Subject: Refactor --- src/pages/my/address/[id]/edit.js | 249 ----------------------------------- src/pages/my/address/create.js | 234 --------------------------------- src/pages/my/address/index.js | 84 ------------ src/pages/my/invoice/[id].js | 149 --------------------- src/pages/my/invoices.js | 180 -------------------------- src/pages/my/menu.js | 82 ------------ src/pages/my/profile.js | 134 ------------------- src/pages/my/transaction/[id].js | 265 -------------------------------------- src/pages/my/transactions.js | 198 ---------------------------- src/pages/my/wishlist.js | 60 --------- 10 files changed, 1635 deletions(-) delete mode 100644 src/pages/my/address/[id]/edit.js delete mode 100644 src/pages/my/address/create.js delete mode 100644 src/pages/my/address/index.js delete mode 100644 src/pages/my/invoice/[id].js delete mode 100644 src/pages/my/invoices.js delete mode 100644 src/pages/my/menu.js delete mode 100644 src/pages/my/profile.js delete mode 100644 src/pages/my/transaction/[id].js delete mode 100644 src/pages/my/transactions.js delete mode 100644 src/pages/my/wishlist.js (limited to 'src/pages/my') diff --git a/src/pages/my/address/[id]/edit.js b/src/pages/my/address/[id]/edit.js deleted file mode 100644 index 838d39e7..00000000 --- a/src/pages/my/address/[id]/edit.js +++ /dev/null @@ -1,249 +0,0 @@ -import { Controller, useForm } from "react-hook-form" -import WithAuth from "@/components/auth/WithAuth"; -import Layout from "@/components/layouts/Layout"; -import AppBar from "@/components/layouts/AppBar"; -import { yupResolver } from "@hookform/resolvers/yup"; -import * as Yup from "yup"; -import { Select } from "@/components/elements/Fields"; -import { useEffect, useState } from "react"; -import apiOdoo from "@/core/utils/apiOdoo"; -import { toast } from "react-hot-toast"; -import { useRouter } from "next/router"; - -const validationSchema = Yup.object().shape({ - type: Yup.string().required('Harus di-pilih'), - name: Yup.string().min(3, 'Minimal 3 karakter').required('Harus di-isi'), - email: Yup.string().email('Format harus seperti johndoe@example.com').required('Harus di-isi'), - mobile: Yup.string().required('Harus di-isi'), - street: Yup.string().required('Harus di-isi'), - zip: Yup.string().required('Harus di-isi'), - city: Yup.string().required('Harus di-pilih'), -}); - -const types = [ - { value: 'contact', label: 'Contact Address' }, - { value: 'invoice', label: 'Invoice Address' }, - { value: 'delivery', label: 'Delivery Address' }, - { value: 'other', label: 'Other Address' }, -]; - -export async function getServerSideProps( context ) { - const { id } = context.query; - const address = await apiOdoo('GET', `/api/v1/partner/${id}/address`); - let defaultValues = { - type: address.type, - name: address.name, - email: address.email, - mobile: address.mobile, - street: address.street, - zip: address.zip, - city: address.city?.id || '', - oldDistrict: address.district?.id || '', - district: '', - oldSubDistrict: address.sub_district?.id || '', - subDistrict: '', - }; - return { props: { id, defaultValues } }; -} - -export default function EditAddress({ id, defaultValues }) { - const router = useRouter(); - const { - register, - formState: { errors }, - handleSubmit, - watch, - setValue, - getValues, - control, - } = useForm({ - resolver: yupResolver(validationSchema), - defaultValues - }); - - const [ cities, setCities ] = useState([]); - const [ districts, setDistricts ] = useState([]); - const [ subDistricts, setSubDistricts ] = useState([]); - - useEffect(() => { - const loadCities = async () => { - let dataCities = await apiOdoo('GET', '/api/v1/city'); - dataCities = dataCities.map((city) => ({ value: city.id, label: city.name })); - setCities(dataCities); - }; - loadCities(); - }, []); - - const watchCity = watch('city'); - useEffect(() => { - setValue('district', ''); - if (watchCity) { - const loadDistricts = async () => { - let dataDistricts = await apiOdoo('GET', `/api/v1/district?city_id=${watchCity}`); - dataDistricts = dataDistricts.map((district) => ({ value: district.id, label: district.name })); - setDistricts(dataDistricts); - let oldDistrict = getValues('oldDistrict'); - if (oldDistrict) { - setValue('district', oldDistrict); - setValue('oldDistrict', ''); - } - }; - loadDistricts(); - } - }, [ watchCity, setValue, getValues ]); - - const watchDistrict = watch('district'); - useEffect(() => { - setValue('subDistrict', ''); - if (watchDistrict) { - const loadSubDistricts = async () => { - let dataSubDistricts = await apiOdoo('GET', `/api/v1/sub_district?district_id=${watchDistrict}`); - dataSubDistricts = dataSubDistricts.map((district) => ({ value: district.id, label: district.name })); - setSubDistricts(dataSubDistricts); - let oldSubDistrict = getValues('oldSubDistrict'); - if (oldSubDistrict) { - setValue('subDistrict', oldSubDistrict); - setValue('oldSubDistrict', ''); - } - }; - loadSubDistricts(); - } - }, [ watchDistrict, setValue, getValues ]) - - const onSubmitHandler = async (values) => { - const parameters = { - ...values, - city_id: values.city, - district_id: values.district, - sub_district_id: values.subDistrict - } - - const address = await apiOdoo('PUT', `/api/v1/partner/${id}/address`, parameters); - if (address?.id) { - toast.success('Berhasil mengubah alamat'); - router.back(); - } - }; - - return ( - - - - -
-
- - -
{ errors.name?.message }
-
- -
- - -
{ errors.email?.message }
-
- -
- - -
{ errors.mobile?.message }
-
- -
- - -
{ errors.street?.message }
-
- -
- - -
{ errors.zip?.message }
-
- -
- - - )} - /> -
- -
- - ( - } - /> -
{ errors.type?.message }
-
- -
- - -
{ errors.name?.message }
-
- -
- - -
{ errors.email?.message }
-
- -
- - -
{ errors.mobile?.message }
-
- -
- - -
{ errors.street?.message }
-
- -
- - -
{ errors.zip?.message }
-
- -
- - - )} - /> -
- -
- - ( - - - - -
- { invoices?.invoice_total === 0 && !isLoading && ( - - Invoice tidak ditemukan - - ) } - { invoices?.invoices?.map((invoice, index) => ( -
-
- - No. Invoice -

{ invoice.name }

- -
- { invoice.amount_residual > 0 ? ( -
Belum Lunas
- ) : ( -
Lunas
- ) } - openPopup(invoice)} /> -
-
- -
-

- { invoice.invoice_date } -

-

- { invoice.payment_term } -

-
-
-
-
- No. Purchase Order -

{ invoice.purchase_order_name || '-' }

-
-
- Total Invoice -

{ currencyFormat(invoice.amount_total) }

-
-
- - { invoice.efaktur ? ( -
- - Faktur Pajak -
- ) : ( -
- - Faktur Pajak -
- ) } -
- )) } -
- -
- -
- { BottomPopup } - - - ) -} \ No newline at end of file diff --git a/src/pages/my/menu.js b/src/pages/my/menu.js deleted file mode 100644 index ae6c2af8..00000000 --- a/src/pages/my/menu.js +++ /dev/null @@ -1,82 +0,0 @@ - -import AppBar from "@/components/layouts/AppBar"; -import Layout from "@/components/layouts/Layout"; -import Link from "@/components/elements/Link"; -import { useAuth } from "@/core/utils/auth"; -import { - ArrowRightOnRectangleIcon, - ChatBubbleLeftRightIcon, - ChevronRightIcon, - MapIcon, - PaperClipIcon, - PencilSquareIcon, - QuestionMarkCircleIcon, - ReceiptPercentIcon, - UserIcon, - HeartIcon -} from "@heroicons/react/24/outline"; -import WithAuth from "@/components/auth/WithAuth"; - -const Menu = ({ icon, name, url }) => { - return ( - - - { icon } - { name } - - - - ); -}; - -export default function MyMenu() { - const [auth] = useAuth(); - - return ( - - - - -
-
-
- -
-
-

{ auth?.name }

- { auth?.company ? ( -
Akun Bisnis
- ) : ( -
Akun Individu
- ) } -
-
- - - -
- -
-

Aktivitas Pembelian

-
- } name="Daftar Transaksi" url="/my/transactions" /> - } name="Invoice & Faktur Pajak" url="/my/invoices" /> - } name="Wishlist" url="/my/wishlist" /> -
- -

Pusat Bantuan

-
- } name="Layanan Pelanggan" url="/" /> - } name="F.A.Q" url="/faqs" /> -
- -

Pengaturan Akun

-
- } name="Daftar Alamat" url="/my/address" /> - } name="Keluar Akun" url="/logout" /> -
-
-
-
- ); -} \ No newline at end of file diff --git a/src/pages/my/profile.js b/src/pages/my/profile.js deleted file mode 100644 index 97891259..00000000 --- a/src/pages/my/profile.js +++ /dev/null @@ -1,134 +0,0 @@ -import { useState } from "react"; -import { toast } from "react-hot-toast"; -import AppBar from "@/components/layouts/AppBar"; -import Layout from "@/components/layouts/Layout"; -import WithAuth from "@/components/auth/WithAuth"; -import apiOdoo from "@/core/utils/apiOdoo"; -import { - useAuth, - setAuth as setAuthCookie, - getAuth -} from "@/core/utils/auth"; - -export default function MyProfile() { - const [auth, setAuth] = useAuth(); - const [editMode, setEditMode] = useState(false); - const [password, setPassword] = useState(''); - - const update = async (e) => { - e.preventDefault(); - let dataToUpdate = { - name: auth.name, - phone: auth.phone, - mobile: auth.mobile - }; - if (password) dataToUpdate.password = password; - let update = await apiOdoo('PUT', `/api/v1/user/${auth.id}`, dataToUpdate); - setAuthCookie(update.user); - cancelEdit(); - toast.success('Berhasil mengubah profil', { duration: 1500 }); - }; - - const handleInput = (e) => { - let authToUpdate = auth; - authToUpdate[e.target.name] = e.target.value; - setAuth({ ...authToUpdate }); - }; - - const cancelEdit = () => { - setEditMode(false); - setAuth(getAuth()); - setPassword(''); - } - - return ( - - - - -
- { auth && ( - <> - - - - - - - - - - - - - - setPassword(e.target.value)} - disabled={!editMode} - /> - - ) } - - { editMode && ( -
- - -
- ) } - - { !editMode && ( - - ) } -
-
-
- ); -} \ No newline at end of file diff --git a/src/pages/my/transaction/[id].js b/src/pages/my/transaction/[id].js deleted file mode 100644 index fb806aa4..00000000 --- a/src/pages/my/transaction/[id].js +++ /dev/null @@ -1,265 +0,0 @@ -import AppBar from "@/components/layouts/AppBar"; -import Layout from "@/components/layouts/Layout"; -import LineDivider from "@/components/elements/LineDivider"; -import WithAuth from "@/components/auth/WithAuth"; -import { useCallback, useEffect, useRef, useState } from "react"; -import apiOdoo from "@/core/utils/apiOdoo"; -import { useRouter } from "next/router"; -import { useAuth } from "@/core/utils/auth"; -import currencyFormat from "@/core/utils/currencyFormat"; -import DescriptionRow from "@/components/elements/DescriptionRow"; -import { TransactionDetailAddress } from "@/components/transactions/TransactionDetail"; -import { SkeletonList } from "@/components/elements/Skeleton"; -import Link from "@/components/elements/Link"; -import { ChevronRightIcon } from "@heroicons/react/24/outline"; -import Alert from "@/components/elements/Alert"; -import TransactionStatusBadge from "@/components/transactions/TransactionStatusBadge"; -import useConfirmAlert from "@/lib/elements/hooks/useConfirmAlert"; -import { toast } from "react-hot-toast"; -import useBottomPopup from "@/lib/elements/hooks/useBottomPopup"; -import getFileBase64 from "@/core/utils/getFileBase64"; -import VariantGroupCard from "@/components/variants/VariantGroupCard"; - -export default function DetailTransaction() { - const router = useRouter(); - const { id } = router.query; - const [ auth ] = useAuth(); - const [ transaction, setTransaction ] = useState(null); - - const loadTransaction = useCallback(async () => { - if (auth && id) { - const dataTransaction = await apiOdoo('GET', `/api/v1/partner/${auth?.partner_id}/sale_order/${id}`); - setTransaction(dataTransaction); - } - }, [ auth, id ]); - - useEffect(() => { - loadTransaction(); - }, [ loadTransaction ]); - - const submitCancelTransaction = async (data) => { - const isCancelled = await apiOdoo('POST', `/api/v1/partner/${auth.partner_id}/sale_order/${data.id}/cancel`); - if (isCancelled) { - toast.success('Berhasil batalkan transaksi'); - loadTransaction(); - } - } - - const { - openConfirmAlert, - ConfirmAlert - } = useConfirmAlert({ - title: 'Batalkan Transaksi', - caption: 'Apakah anda yakin untuk membatalkan transaksi?', - closeText: 'Tidak', - submitText: 'Iya, batalkan', - onSubmit: submitCancelTransaction - }); - - const UploadPurchaseOrder = () => { - const nameRef = useRef(''); - const fileRef = useRef(''); - - const submitUploadPurchaseOrder = async (e) => { - e.preventDefault(); - const file = fileRef.current.files[0]; - const name = nameRef.current.value; - if (file.size > 5000000) { - toast.error('Maksimal ukuran file adalah 5MB', { - position: 'bottom-center' - }); - return; - } - const parameter = { - name, - file: await getFileBase64(file) - }; - const isUploaded = await apiOdoo('POST', `/api/v1/partner/${auth.partner_id}/sale_order/${transaction.id}/upload_po`, parameter); - if (isUploaded) { - toast.success('Berhasil upload PO'); - loadTransaction(); - closePopup(); - } - }; - - return ( -
-
- - -
-
- - -
- -
- ); - } - - const { - closePopup, - BottomPopup, - openPopup - } = useBottomPopup({ - title: 'Upload PO', - children: UploadPurchaseOrder - }); - - const downloadPurchaseOrder = () => { - const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partner_id}/sale_order/${transaction.id}/download_po/${transaction.token}`; - window.open(url, 'download') - }; - - const downloadQuotation = () => { - const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partner_id}/sale_order/${transaction.id}/download/${transaction.token}`; - window.open(url, 'download') - }; - - const checkout = async () => { - if (!transaction.purchase_order_file) { - toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan') - return - } - await apiOdoo('POST', `/api/v1/partner/${auth?.partner_id}/sale_order/${id}/checkout`) - toast.success('Berhasil melanjutkan pesanan') - loadTransaction() - } - - return ( - - - - - { transaction ? ( - <> -
- -
- -
-
- - { transaction?.name } - - - { transaction?.payment_term } - - - { transaction?.sales } - - - { transaction?.date_order } - -
- - - -
- - { transaction?.purchase_order_name || '-' } - -
-

Dokumen PO

- -
-
- - - -

Detail Produk

- -
- -
-

Total Belanja

-

{ currencyFormat(transaction?.amount_total || 0) }

-
-
- - - - - - - -
-

Invoice

-
- { transaction?.invoices?.map((invoice, index) => ( - -
-
-

{ invoice?.name }

-
- { invoice.amount_residual > 0 ? ( -
Belum Lunas
- ) : ( -
Lunas
- ) } -

- { currencyFormat(invoice.amount_total) } -

-
-
- -
- - )) } - { transaction?.invoices?.length === 0 && ( - - Belum ada Invoice - - ) } -
-
- - - -
- { transaction?.status == 'draft' && ( - - ) } - - { transaction?.status != 'draft' && ( - - ) } -
- - ) : ( -
- -
- ) } - { ConfirmAlert } - { BottomPopup } -
-
- ); -} \ No newline at end of file diff --git a/src/pages/my/transactions.js b/src/pages/my/transactions.js deleted file mode 100644 index 8be43af7..00000000 --- a/src/pages/my/transactions.js +++ /dev/null @@ -1,198 +0,0 @@ -import { useRouter } from "next/router"; -import AppBar from "@/components/layouts/AppBar"; -import Layout from "@/components/layouts/Layout"; -import WithAuth from "@/components/auth/WithAuth"; -import { useCallback, useEffect, useRef, useState } from "react"; -import { useAuth } from "@/core/utils/auth"; -import apiOdoo from "@/core/utils/apiOdoo"; -import currencyFormat from "@/core/utils/currencyFormat"; -import { EllipsisVerticalIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline"; -import Link from "@/components/elements/Link"; -import Pagination from "@/components/elements/Pagination"; -import Alert from "@/components/elements/Alert"; -import TransactionStatusBadge from "@/components/transactions/TransactionStatusBadge"; -import { toast } from "react-hot-toast"; -import useConfirmAlert from "@/lib/elements/hooks/useConfirmAlert"; -import useBottomPopup from "@/lib/elements/hooks/useBottomPopup"; - -export default function Transactions() { - const [ auth ] = useAuth(); - const router = useRouter(); - const { - q, - page = 1 - } = router.query; - - const [ transactions, setTransactions ] = useState([]); - - const [ pageCount, setPageCount ] = useState(0); - const [ isLoading, setIsLoading ] = useState(true); - - const searchQueryRef = useRef(); - const loadTransactions = useCallback(async () => { - if (auth) { - const limit = 10; - let offset = (page - 1) * 10; - let queryParams = [`limit=${limit}`, `offset=${offset}`]; - if (q) queryParams.push(`name=${q}`); - queryParams = queryParams.join('&'); - queryParams = queryParams ? '?' + queryParams : ''; - - const dataTransactions = await apiOdoo('GET', `/api/v1/partner/${auth.partner_id}/sale_order${queryParams}`); - setTransactions(dataTransactions); - setPageCount(Math.ceil(dataTransactions?.sale_order_total / limit)); - setIsLoading(false); - }; - }, [ auth, q, page ]); - - useEffect(() => { - loadTransactions(); - }, [ loadTransactions ]); - - const actionSearch = (e) => { - e.preventDefault(); - let queryParams = []; - if (searchQueryRef.current.value) queryParams.push(`q=${searchQueryRef.current.value}`); - queryParams = queryParams.join('&'); - queryParams = queryParams ? `?${queryParams}` : ''; - router.push(`/my/transactions${queryParams}`); - }; - - const downloadPurchaseOrder = (data) => { - const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partner_id}/sale_order/${data.id}/download_po/${data.token}`; - window.open(url, 'download'); - closePopup(); - }; - - const downloadQuotation = (data) => { - const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partner_id}/sale_order/${data.id}/download/${data.token}`; - window.open(url, 'download'); - closePopup(); - }; - - const childrenPopup = (data) => ( -
- - - -
- ); - - const { - closePopup, - openPopup, - BottomPopup - } = useBottomPopup({ - title: 'Lainnya', - children: childrenPopup - }); - - const submitCancelTransaction = async (data) => { - const isCancelled = await apiOdoo('POST', `/api/v1/partner/${auth.partner_id}/sale_order/${data.id}/cancel`); - if (isCancelled) { - toast.success('Berhasil batalkan transaksi'); - loadTransactions(); - } - } - - const { - openConfirmAlert, - ConfirmAlert - } = useConfirmAlert({ - title: 'Batalkan Transaksi', - caption: 'Apakah anda yakin untuk membatalkan transaksi?', - closeText: 'Tidak', - submitText: 'Ya, Batalkan', - onSubmit: submitCancelTransaction - }); - - return ( - - - - -
- - -
- -
- { transactions?.sale_order_total === 0 && !isLoading && ( - - Transaksi tidak ditemukan - - ) } - { transactions?.sale_orders?.map((transaction, index) => ( -
-
- - No. Transaksi -

{ transaction.name }

- -
- - openPopup(transaction)} /> -
-
- -
-
- No. Purchase Order -

{ transaction.purchase_order_name || '-' }

-
-
- Total Invoice -

{ transaction.invoice_count } Invoice

-
-
-
-
- Sales -

{ transaction.sales }

-
-
- Total Harga -

{ currencyFormat(transaction.amount_total) }

-
-
- -
- )) } -
- -
- -
- - { ConfirmAlert } - { BottomPopup } -
-
- ); -}; \ No newline at end of file diff --git a/src/pages/my/wishlist.js b/src/pages/my/wishlist.js deleted file mode 100644 index 3d479802..00000000 --- a/src/pages/my/wishlist.js +++ /dev/null @@ -1,60 +0,0 @@ -import WithAuth from "@/components/auth/WithAuth"; -import Alert from "@/components/elements/Alert"; -import Pagination from "@/components/elements/Pagination"; -import Spinner from "@/components/elements/Spinner"; -import AppBar from "@/components/layouts/AppBar"; -import Layout from "@/components/layouts/Layout"; -import ProductCard from "@/components/products/ProductCard"; -import apiOdoo from "@/core/utils/apiOdoo"; -import { useAuth } from "@/core/utils/auth"; -import { useRouter } from "next/router"; -import { useEffect, useState } from "react"; - -export default function Wishlist() { - const [ auth ] = useAuth(); - const router = useRouter(); - const { page = 1 } = router.query; - const [ wishlists, setWishlists ] = useState(null); - const [ pageCount, setPageCount ] = useState(0); - - useEffect(() => { - const loadWishlist = async () => { - const limit = 10; - const offset = (page - 1) * limit; - if (auth) { - const dataWishlist = await apiOdoo('GET', `/api/v1/user/${auth.id}/wishlist?limit=${limit}&offset=${offset}`); - setWishlists(dataWishlist); - setPageCount(Math.ceil(dataWishlist.product_total / limit)); - } - } - loadWishlist(); - }, [ auth, page ]); - - return ( - - - - -
- { !wishlists && ( - - ) } - { wishlists?.products?.length == 0 && ( - - Wishlist anda masih kosong - - ) } -
- {wishlists?.products.map((product) => ( - - ))} -
- -
- -
-
-
-
- ) -} \ No newline at end of file -- cgit v1.2.3 From ed950b23d50f9b3993cfd2ac2386a5b3a68d5e57 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 20 Feb 2023 17:03:28 +0700 Subject: fix --- src/pages/my/menu.jsx | 94 +++++++++++++++++++++++++++++++++++++++++++ src/pages/my/transactions.jsx | 12 ++++++ 2 files changed, 106 insertions(+) create mode 100644 src/pages/my/menu.jsx create mode 100644 src/pages/my/transactions.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx new file mode 100644 index 00000000..d3edaa3b --- /dev/null +++ b/src/pages/my/menu.jsx @@ -0,0 +1,94 @@ +import Divider from "@/core/components/elements/Divider/Divider" +import Link from "@/core/components/elements/Link/Link" +import AppLayout from "@/core/components/layouts/AppLayout" +import { ChevronRightIcon, UserIcon } from "@heroicons/react/24/solid" + +export default function Menu() { + return ( + + +
+ +
+
+
Rafi Zadanly
+
Akun Bisnis
+
+
+ +
+ + + + +
+
+ + Aktivitas Pembelian + + +
+ + Daftar Transaksi + + + Invoice & Faktur Pajak + + + Wishlist + +
+
+ +
+ + Pusat Bantuan + + +
+ + Customer Support + + + F.A.Q + +
+
+ +
+ + Pengaturan Akun + + +
+ + Daftar Alamat + + + Ubah Password + + + Keluar Akun + +
+
+
+
+ ) +} + +const MenuHeader = ({ children, ...props }) => ( +
+ { children } + +
+) + +const LinkItem = ({ children, ...props }) => ( + + { children } +
+ +
+ +) \ No newline at end of file diff --git a/src/pages/my/transactions.jsx b/src/pages/my/transactions.jsx new file mode 100644 index 00000000..a530afcc --- /dev/null +++ b/src/pages/my/transactions.jsx @@ -0,0 +1,12 @@ +import AppLayout from "@/core/components/layouts/AppLayout" +import dynamic from "next/dynamic" + +const TransactionsComponent = dynamic(() => import("@/lib/transaction/components/Transactions")) + +export default function Transactions() { + return ( + + + + ) +} \ No newline at end of file -- cgit v1.2.3 From fdfb47c3a825258b871ac5921605642e5e05fdd8 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 12:04:20 +0700 Subject: fix --- src/pages/my/transaction/[id].jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/pages/my/transaction/[id].jsx (limited to 'src/pages/my') diff --git a/src/pages/my/transaction/[id].jsx b/src/pages/my/transaction/[id].jsx new file mode 100644 index 00000000..4b81b2a3 --- /dev/null +++ b/src/pages/my/transaction/[id].jsx @@ -0,0 +1,13 @@ +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 ( + + + + ) +} \ No newline at end of file -- cgit v1.2.3 From 3f2ff1475676ba47a841796e39e7d17d627e5356 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 14:46:24 +0700 Subject: fix --- src/pages/my/menu.jsx | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index d3edaa3b..69e4b8bb 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -1,9 +1,20 @@ 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() + const router = useRouter() + + const logout = () => { + deleteAuth() + router.push('/login') + } + return ( @@ -11,8 +22,13 @@ export default function Menu() {
-
Rafi Zadanly
-
Akun Bisnis
+
{ auth?.name }
+ { auth?.company && ( +
Akun Bisnis
+ ) } + { !auth?.company && ( +
Akun Individu
+ ) }
@@ -67,9 +83,9 @@ export default function Menu() { Ubah Password - +
Keluar Akun - +
-- cgit v1.2.3 From de7361718def0f6bb32294bb074841ba2c0a3ce6 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 16:25:35 +0700 Subject: fix --- src/pages/my/invoice/[id].jsx | 13 +++++++++++++ src/pages/my/invoices.jsx | 10 ++++++++++ src/pages/my/menu.jsx | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/pages/my/invoice/[id].jsx create mode 100644 src/pages/my/invoices.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/invoice/[id].jsx b/src/pages/my/invoice/[id].jsx new file mode 100644 index 00000000..a3cbeb5c --- /dev/null +++ b/src/pages/my/invoice/[id].jsx @@ -0,0 +1,13 @@ +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 ( + + + + ) +} \ No newline at end of file diff --git a/src/pages/my/invoices.jsx b/src/pages/my/invoices.jsx new file mode 100644 index 00000000..04842110 --- /dev/null +++ b/src/pages/my/invoices.jsx @@ -0,0 +1,10 @@ +import AppLayout from "@/core/components/layouts/AppLayout" +import InvoicesComponent from "@/lib/invoice/components/Invoices" + +export default function Invoices() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 69e4b8bb..e2a11390 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -47,10 +47,10 @@ export default function Menu() { Daftar Transaksi - + Invoice & Faktur Pajak - + Wishlist -- cgit v1.2.3 From 5933732a74ae1ca4124ddd4e8265b1f443234736 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 21:51:51 +0700 Subject: fix --- src/pages/my/wishlist.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/pages/my/wishlist.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx new file mode 100644 index 00000000..b7a3e4fe --- /dev/null +++ b/src/pages/my/wishlist.jsx @@ -0,0 +1,10 @@ +import AppLayout from "@/core/components/layouts/AppLayout" +import Wishlists from "@/lib/wishlist/components/Wishlists" + +export default function Wishlist() { + return ( + + + + ) +} \ No newline at end of file -- cgit v1.2.3 From 706088ffe9e13221207837bb658887645e76b3ed Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 21:59:24 +0700 Subject: fix --- src/pages/my/menu.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index e2a11390..0bd6137e 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -101,7 +101,7 @@ const MenuHeader = ({ children, ...props }) => ( ) const LinkItem = ({ children, ...props }) => ( - + { children }
-- cgit v1.2.3 From 98c8fc56db91664b98a50e9113787b56fe785b9e Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 22:33:32 +0700 Subject: fix --- src/pages/my/address/index.jsx | 10 ++++++++++ src/pages/my/menu.jsx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/pages/my/address/index.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/address/index.jsx b/src/pages/my/address/index.jsx new file mode 100644 index 00000000..29e21c30 --- /dev/null +++ b/src/pages/my/address/index.jsx @@ -0,0 +1,10 @@ +import AppLayout from "@/core/components/layouts/AppLayout" +import AddressesComponent from "@/lib/address/components/Addresses" + +export default function Addresses() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 0bd6137e..2ae00722 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -77,7 +77,7 @@ export default function Menu() {
- + Daftar Alamat -- cgit v1.2.3 From 82954ee3cfa38f21f677b9aa2c1c6c3c88004050 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 08:35:02 +0700 Subject: fix --- src/pages/my/menu.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index e2a11390..67ea1171 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -18,7 +18,7 @@ export default function Menu() { return ( -
+
@@ -80,9 +80,6 @@ export default function Menu() { Daftar Alamat - - Ubah Password -
Keluar Akun
-- cgit v1.2.3 From 3c559031623649a67825ff47f34512f0eb946861 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 10:14:32 +0700 Subject: fix --- src/pages/my/address/[id]/edit.jsx | 30 ++++++++++++++++++++++++++++++ src/pages/my/address/create.jsx | 10 ++++++++++ src/pages/my/menu.jsx | 7 ++++--- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/pages/my/address/[id]/edit.jsx create mode 100644 src/pages/my/address/create.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx new file mode 100644 index 00000000..feff85fd --- /dev/null +++ b/src/pages/my/address/[id]/edit.jsx @@ -0,0 +1,30 @@ +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 ( + + + + ) +} + +export async function getServerSideProps(context) { + const { id } = context.query + const address = await addressApi({ id }) + const defaultValues = { + type: address.type, + name: address.name, + email: address.email, + mobile: address.mobile, + street: address.street, + zip: address.zip, + 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 new file mode 100644 index 00000000..dfc84444 --- /dev/null +++ b/src/pages/my/address/create.jsx @@ -0,0 +1,10 @@ +import AppLayout from "@/core/components/layouts/AppLayout" +import CreateAddressComponent from "@/lib/address/components/CreateAddress" + +export default function CreateAddress() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 46a0e4b3..3620fc36 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -80,9 +80,10 @@ export default function Menu() { Daftar Alamat -
- Keluar Akun -
+
+ +
+
-- cgit v1.2.3 From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 11:03:34 +0700 Subject: prettier --- src/pages/my/address/[id]/edit.jsx | 18 +++---- src/pages/my/address/create.jsx | 8 +-- src/pages/my/address/index.jsx | 8 +-- src/pages/my/invoice/[id].jsx | 10 ++-- src/pages/my/invoices.jsx | 8 +-- src/pages/my/menu.jsx | 103 ++++++++++++++----------------------- src/pages/my/transaction/[id].jsx | 10 ++-- src/pages/my/transactions.jsx | 10 ++-- src/pages/my/wishlist.jsx | 8 +-- 9 files changed, 80 insertions(+), 103 deletions(-) (limited to 'src/pages/my') 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 ( - + ) @@ -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 ( - + ) -} \ 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 ( - + ) -} \ 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 ( - + ) -} \ 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 ( - + ) -} \ 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 ( - - -
- + + +
+
-
-
{ auth?.name }
- { auth?.company && ( -
Akun Bisnis
- ) } - { !auth?.company && ( -
Akun Individu
- ) } +
+
{auth?.name}
+ {auth?.company &&
Akun Bisnis
} + {!auth?.company &&
Akun Individu
}
-
- +
+
-
+
- - Aktivitas Pembelian - + Aktivitas Pembelian -
- - Daftar Transaksi - - - Invoice & Faktur Pajak - - - Wishlist - +
+ Daftar Transaksi + Invoice & Faktur Pajak + Wishlist
- - Pusat Bantuan - + Pusat Bantuan -
- - Customer Support - - - F.A.Q - +
+ Customer Support + F.A.Q
- - Pengaturan Akun - + Pengaturan Akun -
- - Daftar Alamat - +
+ Daftar Alamat
-
- +
+
@@ -92,17 +70,16 @@ export default function Menu() { } const MenuHeader = ({ children, ...props }) => ( -
- { children } - +
+ {children}
) const LinkItem = ({ children, ...props }) => ( - - { children } -
- + + {children} +
+
-) \ 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 ( - + ) -} \ 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 ( - + ) -} \ 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 ( - + ) -} \ No newline at end of file +} -- cgit v1.2.3 From 321e0c09be4b26d72b470407217262d10c88089d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 22:57:48 +0700 Subject: fix --- src/pages/my/profile.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/pages/my/profile.jsx (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx new file mode 100644 index 00000000..f69d4303 --- /dev/null +++ b/src/pages/my/profile.jsx @@ -0,0 +1,10 @@ +import AppLayout from '@/core/components/layouts/AppLayout' +import PersonalProfile from '@/lib/auth/components/PersonalProfile' + +export default function Profile() { + return ( + + + + ) +} -- cgit v1.2.3 From ac3fdf7be9982e65d8f83a20bc487f8dd62e3bfc Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 23:36:47 +0700 Subject: fix --- src/pages/my/address/[id]/edit.jsx | 5 ++++- src/pages/my/menu.jsx | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx index a7c22147..65d7cf9b 100644 --- a/src/pages/my/address/[id]/edit.jsx +++ b/src/pages/my/address/[id]/edit.jsx @@ -5,7 +5,10 @@ import EditAddressComponent from '@/lib/address/components/EditAddress' export default function EditAddress({ id, defaultValues }) { return ( - + ) } diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 0edc98ae..576919ae 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -17,7 +17,10 @@ export default function Menu() { return ( - +
@@ -60,7 +63,10 @@ export default function Menu() { Daftar Alamat
-
+
@@ -70,13 +76,19 @@ export default function Menu() { } const MenuHeader = ({ children, ...props }) => ( -
+
{children}
) const LinkItem = ({ children, ...props }) => ( - + {children}
-- cgit v1.2.3 From 0de0fda98dc35bd6503f1a45a52878b154a94c75 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 23 Feb 2023 10:52:40 +0700 Subject: fox --- src/pages/my/profile.jsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index f69d4303..f8d4c3de 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -1,10 +1,14 @@ +import Divider from '@/core/components/elements/Divider/Divider' import AppLayout from '@/core/components/layouts/AppLayout' +import CompanyProfile from '@/lib/auth/components/CompanyProfile' import PersonalProfile from '@/lib/auth/components/PersonalProfile' export default function Profile() { return ( + + ) } -- cgit v1.2.3 From 70d7b4cfad767be2d066cc66cf13b3e06e860f73 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 23 Feb 2023 11:22:45 +0700 Subject: fix --- src/pages/my/profile.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index f8d4c3de..85361f1e 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -1,14 +1,16 @@ 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 PersonalProfile from '@/lib/auth/components/PersonalProfile' export default function Profile() { + const auth = useAuth() return ( - + { auth?.parentId && } ) } -- cgit v1.2.3 From ccf4174e7e2e8a3f4cc35f243695f900f2172bb4 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 23 Feb 2023 13:19:17 +0700 Subject: fixc --- src/pages/my/profile.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/my') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 85361f1e..8a91ea17 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -10,7 +10,7 @@ export default function Profile() { - { auth?.parentId && } + {auth?.parentId && } ) } -- cgit v1.2.3 From ffa261e6adef70a2845878cf93e6e492eb8cee62 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 27 Feb 2023 10:49:45 +0700 Subject: footer --- src/pages/my/address/[id]/edit.jsx | 15 ++++--- src/pages/my/address/create.jsx | 9 ++-- src/pages/my/address/index.jsx | 9 ++-- src/pages/my/invoice/[id].jsx | 9 ++-- src/pages/my/invoices.jsx | 9 ++-- src/pages/my/menu.jsx | 91 ++++++++++++++++++++------------------ src/pages/my/profile.jsx | 13 +++--- src/pages/my/transaction/[id].jsx | 9 ++-- src/pages/my/transactions.jsx | 9 ++-- src/pages/my/wishlist.jsx | 9 ++-- 10 files changed, 106 insertions(+), 76 deletions(-) (limited to 'src/pages/my') 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } 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 ( - - -
- -
-
-
{auth?.name}
- {auth?.company &&
Akun Bisnis
} - {!auth?.company &&
Akun Individu
} -
-
- -
- + + + +
+ +
+
+
{auth?.name}
+ {auth?.company &&
Akun Bisnis
} + {!auth?.company &&
Akun Individu
} +
+
+ +
+ - + -
-
- Aktivitas Pembelian +
+
+ Aktivitas Pembelian -
- Daftar Transaksi - Invoice & Faktur Pajak - Wishlist +
+ Daftar Transaksi + Invoice & Faktur Pajak + Wishlist +
-
-
- Pusat Bantuan +
+ Pusat Bantuan -
- Customer Support - F.A.Q +
+ Customer Support + F.A.Q +
-
-
- Pengaturan Akun +
+ Pengaturan Akun -
- Daftar Alamat -
+
+ Daftar Alamat +
-
- +
+ +
-
- + + ) } 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 ( - - - - {auth?.parentId && } - + + + + + {auth?.parentId && } + + ) } 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } 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 ( - - - + + + + + ) } -- cgit v1.2.3 From a1b9b647a6c4bda1f5db63879639d44543f9557e Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 1 Mar 2023 13:53:31 +0700 Subject: fix layout --- src/pages/my/menu.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/my') diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 40c84668..b9fd30ee 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -54,7 +54,7 @@ export default function Menu() {
Customer Support - F.A.Q + F.A.Q
@@ -90,7 +90,7 @@ const MenuHeader = ({ children, ...props }) => ( const LinkItem = ({ children, ...props }) => ( {children}
-- cgit v1.2.3