From bc8e76f00eaa74eb0cc51b79662a53ef34a3ed67 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 24 Mar 2023 17:05:47 +0700 Subject: - --- .../elements/Navbar/NavbarUserDropdown.jsx | 18 +- src/core/hooks/useDevice.js | 2 - src/lib/cart/components/Cart.jsx | 15 +- src/lib/product/api/productPriceApi.js | 8 + src/lib/product/components/ProductCard.jsx | 12 + .../components/TransactionStatusBadge.jsx | 2 +- src/lib/transaction/components/Transactions.jsx | 340 ++++++++++++--------- src/pages/my/transactions.jsx | 17 +- src/styles/globals.css | 32 +- 9 files changed, 277 insertions(+), 169 deletions(-) create mode 100644 src/lib/product/api/productPriceApi.js diff --git a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx index b735c13f..c08d81ce 100644 --- a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx +++ b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx @@ -1,17 +1,25 @@ import { deleteAuth } from '@/core/utils/auth' import Link from '../Link/Link' +import { useRouter } from 'next/router' const NavbarUserDropdown = () => { + const router = useRouter() + + const logout = () => { + deleteAuth() + router.push('/login') + } + return (
- Daftar Transaksi - Invoice & Faktur Pajak - Wishlist + Daftar Transaksi + Invoice & Faktur Pajak + Wishlist Pengaturan Akun - +
) diff --git a/src/core/hooks/useDevice.js b/src/core/hooks/useDevice.js index 387330b0..a8584692 100644 --- a/src/core/hooks/useDevice.js +++ b/src/core/hooks/useDevice.js @@ -9,11 +9,9 @@ const useDevice = () => { if (window.innerWidth < 768) { setIsMobile(true) setIsDesktop(false) - console.count('m: true | d: false') } else { setIsMobile(false) setIsDesktop(true) - console.count('m: false | d: true') } } handleResize() diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index 8bd9e362..8cd6df96 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -128,16 +128,16 @@ const Cart = () => { Apakah anda yakin menghapus barang{' '} {deleteConfirmation?.name} dari keranjang? -
+
- - - {transactions.isLoading && ( -
- -
- )} - - {!transactions.isLoading && transactions.data?.saleOrders?.length === 0 && ( - - Tidak ada data transaksi - - )} - - {transactions.data?.saleOrders?.map((saleOrder, index) => ( -
-
- - No. Transaksi -

{saleOrder.name}

- -
- - setToOthers(saleOrder)} - /> + <> + +
+
+ setInputQuery(e.target.value)} + /> + +
+ + {transactions.isLoading && ( +
+
-
- -
-
- No. Purchase Order -

- {saleOrder.purchaseOrderName || '-'} -

-
-
- Total Invoice -

{saleOrder.invoiceCount} Invoice

+ )} + + {!transactions.isLoading && transactions.data?.saleOrders?.length === 0 && ( + + Tidak ada data transaksi + + )} + + {transactions.data?.saleOrders?.map((saleOrder, index) => ( +
+
+ + No. Transaksi +

{saleOrder.name}

+ +
+ + setToOthers(saleOrder)} + /> +
+ +
+
+ No. Purchase Order +

+ {saleOrder.purchaseOrderName || '-'} +

+
+
+ Total Invoice +

+ {saleOrder.invoiceCount} Invoice +

+
+
+
+
+ Sales +

{saleOrder.sales}

+
+
+ Total Harga +

+ {currencyFormat(saleOrder.amountTotal)} +

+
+
+
-
-
- Sales -

{saleOrder.sales}

-
-
- Total Harga -

- {currencyFormat(saleOrder.amountTotal)} -

-
+ ))} + + + + setToOthers(null)}> +
+ + +
- -
- ))} - - - - setToOthers(null)} - > -
- - - -
-
- - setToCancel(null)} - title='Batalkan Transaksi' - > -
- Apakah anda yakin membatalkan transaksi{' '} - {toCancel?.name}? + + + setToCancel(null)} title='Batalkan Transaksi'> +
+ Apakah anda yakin membatalkan transaksi{' '} + {toCancel?.name}? +
+
+ + +
+
-
- - + + + +
+
+
+
+

Daftar Transaksi

+
+ setInputQuery(e.target.value)} + /> + +
+
+ + + + + + + + + + + + {transactions.data?.saleOrders?.map((saleOrder) => ( + + + + + + + + ))} + +
No. TransaksiTanggalSales PersonTotalStatus
+ {saleOrder.name} + -{saleOrder.sales}{currencyFormat(saleOrder.amountTotal)} +
+ +
+
+ + +
- -
+ + ) } diff --git a/src/pages/my/transactions.jsx b/src/pages/my/transactions.jsx index 30b9be07..a8ca78b8 100644 --- a/src/pages/my/transactions.jsx +++ b/src/pages/my/transactions.jsx @@ -1,4 +1,7 @@ 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 IsAuth from '@/lib/auth/components/IsAuth' import dynamic from 'next/dynamic' @@ -7,9 +10,17 @@ const TransactionsComponent = dynamic(() => import('@/lib/transaction/components export default function Transactions() { return ( - - - + + + + + + + + + + + ) } diff --git a/src/styles/globals.css b/src/styles/globals.css index 90761309..7f33abe8 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -394,10 +394,6 @@ button { @apply !border-yellow_r-9; } -nav:has(> div.overlay) { - @apply z-0; -} - .table-specification { @apply max-h-[500px] overflow-y-auto border border-gray_r-6; } @@ -463,6 +459,29 @@ nav:has(> div.overlay) { @apply font-medium; } +.table-data thead tr { + @apply bg-gray_r-3; +} + +.table-data thead th { + @apply font-medium; +} + +.table-data thead th, +.table-data tbody td { + @apply py-3 + text-center; +} + +.table-data tbody td { + @apply text-gray_r-12/90; +} + +.table-data tbody tr { + @apply border-b + border-gray_r-6; +} + .navbar-user-dropdown-button { @apply flex-1 flex @@ -480,8 +499,9 @@ nav:has(> div.overlay) { @apply line-clamp-1; } -.navbar-user-dropdown-wrapper a { - @apply text-gray_r-12/80 hover:bg-gray_r-5 font-medium py-2 px-4; +.navbar-user-dropdown-wrapper a, +.navbar-user-dropdown-wrapper button { + @apply text-gray_r-12/80 hover:bg-gray_r-5 font-medium py-2 px-4 w-full text-left; } .navbar-user-dropdown { -- cgit v1.2.3 From 1f20fafef46b4eecaf0dd1b91592f3214e8144d3 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sat, 25 Mar 2023 12:24:03 +0700 Subject: variant and product price --- .../components/elements/Skeleton/PriceSkeleton.jsx | 9 ++ .../product/components/Product/ProductDesktop.jsx | 79 +++++++++------ .../product/components/Product/ProductMobile.jsx | 54 ++++++---- src/lib/product/components/ProductCard.jsx | 111 +++++++++++++-------- src/lib/product/hooks/useProductPrice.js | 13 +++ src/lib/variant/api/variantPriceApi.js | 8 ++ src/lib/variant/hooks/useVariantPrice.js | 13 +++ 7 files changed, 198 insertions(+), 89 deletions(-) create mode 100644 src/core/components/elements/Skeleton/PriceSkeleton.jsx create mode 100644 src/lib/product/hooks/useProductPrice.js create mode 100644 src/lib/variant/api/variantPriceApi.js create mode 100644 src/lib/variant/hooks/useVariantPrice.js diff --git a/src/core/components/elements/Skeleton/PriceSkeleton.jsx b/src/core/components/elements/Skeleton/PriceSkeleton.jsx new file mode 100644 index 00000000..0dc4c70f --- /dev/null +++ b/src/core/components/elements/Skeleton/PriceSkeleton.jsx @@ -0,0 +1,9 @@ +const PriceSkeleton = () => ( +
+
+
+ Loading... +
+) + +export default PriceSkeleton diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 98b40400..663d5a74 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -8,8 +8,12 @@ import LazyLoad from 'react-lazy-load' import ProductSimilar from '../ProductSimilar' import { toast } from 'react-hot-toast' import { updateItemCart } from '@/core/utils/cart' +import useVariantPrice from '@/lib/variant/hooks/useVariantPrice' +import useProductPrice from '../../hooks/useProductPrice' +import PriceSkeleton from '@/core/components/elements/Skeleton/PriceSkeleton' const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { + const { productPrice } = useProductPrice({ id: product.id }) const [informationTab, setInformationTab] = useState(informationTabOptions[0].value) const variantQuantityRefs = useRef([]) @@ -104,28 +108,33 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { {product.variants.length > 1 && product.lowestPrice.priceDiscount > 0 && (
Harga mulai dari:
)} - {product?.lowestPrice.discountPercentage > 0 && ( -
-
- {product?.lowestPrice.discountPercentage}% -
-
- {currencyFormat(product?.lowestPrice.price)} -
-
+ {productPrice.isLoading && } + {productPrice.isFetched && ( + <> + {productPrice?.data?.discount > 0 && ( +
+
+ {productPrice?.data?.discount}% +
+
+ {currencyFormat(productPrice?.data?.priceExclude)} +
+
+ )} +

+ {productPrice?.data?.priceExcludeAfterDiscount > 0 ? ( + currencyFormat(productPrice?.data?.priceExcludeAfterDiscount) + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

+ )} -

- {product?.lowestPrice.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice.priceDiscount) - ) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - - )} -

{activeVariant?.name}

- {activeVariant?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(activeVariant?.price?.price)} -
-
{activeVariant?.price?.discountPercentage}%
-
- )} -

- {activeVariant?.price?.priceDiscount > 0 ? ( - currencyFormat(activeVariant?.price?.priceDiscount) - ) : ( - - Hubungi kami untuk dapatkan harga terbaik,  - - klik disini - - - )} -

+
@@ -249,6 +232,37 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { ) } +const VariantPrice = ({ id }) => { + const { variantPrice } = useVariantPrice({ id }) + + if (variantPrice.isLoading) return + + return ( + <> + {variantPrice?.data?.discount > 0 && ( +
+
+ {currencyFormat(variantPrice?.data?.priceExclude)} +
+
{variantPrice?.data?.discount}%
+
+ )} +

+ {variantPrice?.data?.priceExcludeAfterDiscount > 0 ? ( + currencyFormat(variantPrice?.data?.priceExcludeAfterDiscount) + ) : ( + + Hubungi kami untuk dapatkan harga terbaik,  + + klik disini + + + )} +

+ + ) +} + const informationTabOptions = [ { value: 'specification', label: 'Spesifikasi' }, { value: 'description', label: 'Deskripsi' }, diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 5710e9ea..e48ab88a 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -2,20 +2,11 @@ import Image from '@/core/components/elements/Image/Image' import Link from '@/core/components/elements/Link/Link' import currencyFormat from '@/core/utils/currencyFormat' import { createSlug } from '@/core/utils/slug' -import { useEffect, useState } from 'react' -import productPriceApi from '../api/productPriceApi' +import useProductPrice from '../hooks/useProductPrice' +import { LazyLoadComponent } from 'react-lazy-load-image-component' +import PriceSkeleton from '@/core/components/elements/Skeleton/PriceSkeleton' const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { - const [price, setPrice] = useState(null) - - useEffect(() => { - const loadPrice = async () => { - const dataPrice = await productPriceApi({ id: product.id }) - // console.log(dataPrice) - } - loadPrice() - }) - if (variant == 'vertical') { return (
@@ -57,22 +48,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { > {product?.name} - {product?.lowestPrice?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.lowestPrice?.price)} -
-
{product?.lowestPrice?.discountPercentage}%
-
- )} - -
- {product?.lowestPrice?.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice?.priceDiscount) - ) : ( - Call for price - )} -
+ + + {product?.stockTotal > 0 && (
Ready Stock
@@ -128,30 +106,83 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.name} - {product?.lowestPrice?.discountPercentage > 0 && ( + + + + {product?.stockTotal > 0 && ( +
+
Ready Stock
+
{product?.stockTotal > 5 ? '> 5' : '< 5'}
+
+ )} +
+
+ ) + } +} + +const ProductCardPrice = ({ variant, id }) => { + const { productPrice } = useProductPrice({ id }) + + if (productPrice.isLoading) return + + if (variant == 'vertical') { + return ( + productPrice.isFetched && ( + <> + {productPrice?.data?.discount > 0 && (
-
{product?.lowestPrice?.discountPercentage}%
-
- {currencyFormat(product?.lowestPrice?.price)} +
+ {currencyFormat( + productPrice?.data?.priceStartFrom || productPrice?.data?.priceExclude + )}
+
{productPrice?.data?.discount}%
)}
- {product?.lowestPrice?.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice?.priceDiscount) + {productPrice?.data?.priceExcludeAfterDiscount > 0 ? ( + currencyFormat( + productPrice?.data?.priceDiscStartFrom || + productPrice?.data?.priceExcludeAfterDiscount + ) ) : ( Call for price )}
- {product?.stockTotal > 0 && ( -
-
Ready Stock
-
{product?.stockTotal > 5 ? '> 5' : '< 5'}
+ + ) + ) + } + + if (variant == 'horizontal') { + return ( + productPrice.isFetched && ( + <> + {productPrice?.data?.discount > 0 && ( +
+
{productPrice?.data?.discount}%
+
+ {currencyFormat( + productPrice?.data?.priceStartFrom || productPrice?.data?.priceExclude + )} +
)} -
-
+ +
+ {productPrice?.data?.priceExcludeAfterDiscount > 0 ? ( + currencyFormat( + productPrice?.data?.priceDiscStartFrom || + productPrice?.data?.priceExcludeAfterDiscount + ) + ) : ( + Call for price + )} +
+ + ) ) } } diff --git a/src/lib/product/hooks/useProductPrice.js b/src/lib/product/hooks/useProductPrice.js new file mode 100644 index 00000000..f8ef62b8 --- /dev/null +++ b/src/lib/product/hooks/useProductPrice.js @@ -0,0 +1,13 @@ +import { useQuery } from 'react-query' +import productPriceApi from '../api/productPriceApi' + +const useProductPrice = ({ id }) => { + const fetchProductPrice = async () => await productPriceApi({ id }) + const productPrice = useQuery(`productPrice-${id}`, fetchProductPrice, { + refetchOnWindowFocus: false + }) + + return { productPrice } +} + +export default useProductPrice diff --git a/src/lib/variant/api/variantPriceApi.js b/src/lib/variant/api/variantPriceApi.js new file mode 100644 index 00000000..8621ca78 --- /dev/null +++ b/src/lib/variant/api/variantPriceApi.js @@ -0,0 +1,8 @@ +import odooApi from '@/core/api/odooApi' + +const variantPriceApi = async ({ id }) => { + const dataVariantPrice = await odooApi('GET', `/api/v1/product/product/price/${id}`) + return dataVariantPrice +} + +export default variantPriceApi diff --git a/src/lib/variant/hooks/useVariantPrice.js b/src/lib/variant/hooks/useVariantPrice.js new file mode 100644 index 00000000..d00eb810 --- /dev/null +++ b/src/lib/variant/hooks/useVariantPrice.js @@ -0,0 +1,13 @@ +import { useQuery } from 'react-query' +import variantPriceApi from '../api/variantPriceApi' + +const useVariantPrice = ({ id }) => { + const fetchVariantPrice = async () => await variantPriceApi({ id }) + const variantPrice = useQuery(`variantPrice-${id}`, fetchVariantPrice, { + refetchOnWindowFocus: false + }) + + return { variantPrice } +} + +export default useVariantPrice -- cgit v1.2.3 From de5ef26bb1017540969f8847016193f7e1933ee1 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sun, 26 Mar 2023 15:10:59 +0700 Subject: transaction detail --- src/core/components/elements/Popup/BottomPopup.jsx | 4 +- src/lib/auth/components/Menu.jsx | 47 ++ src/lib/transaction/components/Transaction.jsx | 471 ++++++++++++++------- src/lib/transaction/components/Transactions.jsx | 12 +- src/pages/my/menu.jsx | 2 +- src/pages/my/transaction/[id].jsx | 17 +- src/styles/globals.css | 4 + 7 files changed, 395 insertions(+), 162 deletions(-) create mode 100644 src/lib/auth/components/Menu.jsx diff --git a/src/core/components/elements/Popup/BottomPopup.jsx b/src/core/components/elements/Popup/BottomPopup.jsx index 95c75473..c244330c 100644 --- a/src/core/components/elements/Popup/BottomPopup.jsx +++ b/src/core/components/elements/Popup/BottomPopup.jsx @@ -49,8 +49,8 @@ const BottomPopup = ({ children, active = false, title, close }) => { diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx new file mode 100644 index 00000000..3f2b2fb2 --- /dev/null +++ b/src/lib/auth/components/Menu.jsx @@ -0,0 +1,47 @@ +import Link from '@/core/components/elements/Link/Link' +import { useRouter } from 'next/router' + +const Menu = () => { + const router = useRouter() + + const routeStartWith = (route) => router.pathname.startsWith(route) + + return ( +
+
Menu
+ + Daftar Transaksi + + + Invoice & Faktur Pajak + + + Wishlist + + +
Pusat Bantuan
+ Layanan Pelanggan + +
Pengaturan Akun
+ + Daftar Alamat + + +
+ ) +} + +const LinkItem = ({ children, ...props }) => ( + + {children} + +) + +export default Menu diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index dc9338fa..dbfdbae9 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -15,6 +15,11 @@ import Link from '@/core/components/elements/Link/Link' import Alert from '@/core/components/elements/Alert/Alert' import checkoutPoApi from '../api/checkoutPoApi' import cancelTransactionApi from '../api/cancelTransactionApi' +import MobileView from '@/core/components/views/MobileView' +import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' +import Image from '@/core/components/elements/Image/Image' +import { createSlug } from '@/core/utils/slug' const Transaction = ({ id }) => { const { transaction } = useTransaction({ id }) @@ -88,10 +93,7 @@ const Transaction = ({ id }) => { const memoizeVariantGroupCard = useMemo( () => (
- +

Subtotal

{currencyFormat(totalAmount)}

@@ -124,120 +126,6 @@ const Transaction = ({ id }) => { return ( transaction.data?.name && ( <> -
- -
- -
-
- {transaction.data?.name} - - {transaction.data?.paymentTerm} - - {transaction.data?.sales} - {transaction.data?.dateOrder} -
- - - -
- - {transaction.data?.purchaseOrderName || '-'} - -
-

Dokumen PO

- -
-
- - - -
Detail Produk
- - {memoizeVariantGroupCard} - - - - - - - -
-

Invoice

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

{invoice?.name}

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

- {currencyFormat(invoice.amountTotal)} -

-
-
- -
- - ))} - {transaction.data?.invoices?.length === 0 && ( - - Belum ada Invoice - - )} -
-
- - - -
- {transaction.data?.status == 'draft' && ( - - )} - - {transaction.data?.status != 'draft' && ( - - )} -
- { > Ya, Batalkan -
- +
- +
- +
- -
+ + +
+ +
+ +
+
+ {transaction.data?.name} + + {transaction.data?.paymentTerm} + + {transaction.data?.sales} + {transaction.data?.dateOrder} +
+ + + +
+ + {transaction.data?.purchaseOrderName || '-'} + +
+

Dokumen PO

+ +
+
+ + + +
Detail Produk
+ + {memoizeVariantGroupCard} + + + + + + + +
+

Invoice

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

{invoice?.name}

+
+ {invoice.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} +

+ {currencyFormat(invoice.amountTotal)} +

+
+
+ +
+ + ))} + {transaction.data?.invoices?.length === 0 && ( + + Belum ada Invoice + + )} +
+
+ + + +
+ {transaction.data?.status == 'draft' && ( + + )} + + {transaction.data?.status != 'draft' && ( + + )} +
+
+ + +
+
+ +
+
+

Detail Transaksi

+ +
+ {transaction?.data?.name} + +
+ + +
+
+
Nama Sales
+
: {transaction?.data?.sales}
+ +
Tanggal Transaksi
+
: {transaction?.data?.dateOrder}
+
+
+
Ketentuan Pembayaran
+
: {transaction?.data?.paymentTerm}
+ +
Purchase Order
+
+ : {transaction?.data?.purchaseOrderName}{' '} + +
+
+
+ +
Info Pengiriman
+
+
+
Detail Pelanggan
+ +
+
+
Detail Pengiriman
+ +
+
+
Detail Penagihan
+ +
+
+ +
Rincian Pembelian
+ + + + + + + + + + + + {transaction?.data?.products?.map((product) => ( + + + + + + + + ))} + +
Nama ProdukJumlahHargaDiskonSubtotal
+ + {product?.name} + +
+ + {product?.parent?.name} + +
+ {product?.code}{' '} + {product?.attributes.length > 0 + ? `| ${product?.attributes.join(', ')}` + : ''} +
+
+
{product.quantity}{currencyFormat(product.price.price)} + {product.price.discountPercentage > 0 + ? `${product.price.discountPercentage}%` + : ''} + {currencyFormat(product.price.priceDiscount)}
+ +
+
+
Subtotal
+
{currencyFormat(totalAmount)}
+ +
Total Diskon
+
+ {currencyFormat(-totalDiscountAmount)} +
+ +
PPN 11% (Incl.)
+
{currencyFormat(totalAmount * 0.11)}
+ +
Grand Total
+
+ {currencyFormat(transaction.data?.amountTotal)} +
+
+
+ +
Invoice
+
+ {transaction.data?.invoices?.map((invoice, index) => ( + +
+
+

{invoice?.name}

+
+ {invoice.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} +

+ {currencyFormat(invoice.amountTotal)} +

+
+
+ +
+ + ))} +
+ {transaction.data?.invoices?.length === 0 && ( + + Belum ada Invoice + + )} + +
+ {transaction.data?.status == 'draft' && ( + + )} + {transaction.data?.status != 'draft' && ( + + )} +
+
+
+
) ) @@ -351,10 +519,7 @@ const SectionAddress = ({ address }) => { } const SectionButton = ({ label, active, toggle }) => ( - @@ -369,7 +534,7 @@ const SectionContent = ({ address }) => { fullAddress = fullAddress.join(', ') return ( -
+
{address.name} {address.email || '-'} {address.mobile || '-'} diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index 3d3dd533..0a772967 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -17,6 +17,7 @@ import _ from 'lodash' import Alert from '@/core/components/elements/Alert/Alert' import MobileView from '@/core/components/views/MobileView' import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' const Transactions = () => { const router = useRouter() @@ -196,10 +197,15 @@ const Transactions = () => {
-
+
+ +
-

Daftar Transaksi

+

+ Daftar Transaksi{' '} + {transactions?.data?.saleOrders ? `(${transactions?.data?.saleOrders.length})` : ''} +

{
- +
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 67158242..851bcf56 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -53,7 +53,7 @@ export default function Menu() { Pusat Bantuan
- Customer Support + Layanan Pelanggan
diff --git a/src/pages/my/transaction/[id].jsx b/src/pages/my/transaction/[id].jsx index 5167748c..c3283783 100644 --- a/src/pages/my/transaction/[id].jsx +++ b/src/pages/my/transaction/[id].jsx @@ -1,4 +1,7 @@ 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 IsAuth from '@/lib/auth/components/IsAuth' import TransactionComponent from '@/lib/transaction/components/Transaction' import { useRouter } from 'next/router' @@ -8,9 +11,17 @@ export default function Transaction() { return ( - - - + + + + + + + + + + + ) } diff --git a/src/styles/globals.css b/src/styles/globals.css index 7f33abe8..d43dad1f 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -459,6 +459,10 @@ button { @apply font-medium; } +.table-data { + @apply w-full; +} + .table-data thead tr { @apply bg-gray_r-3; } -- cgit v1.2.3 From 3f8a37b15c3fd1168b01390241cda7fa2ba980c7 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sun, 26 Mar 2023 15:15:08 +0700 Subject: fix --- src/lib/transaction/components/Transaction.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index dbfdbae9..cba7646f 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -20,6 +20,7 @@ import DesktopView from '@/core/components/views/DesktopView' import Menu from '@/lib/auth/components/Menu' import Image from '@/core/components/elements/Image/Image' import { createSlug } from '@/core/utils/slug' +import toTitleCase from '@/core/utils/toTitleCase' const Transaction = ({ id }) => { const { transaction } = useTransaction({ id }) @@ -528,9 +529,9 @@ const SectionButton = ({ label, active, toggle }) => ( const SectionContent = ({ address }) => { let fullAddress = [] if (address?.street) fullAddress.push(address.street) - if (address?.subDistrict?.name) fullAddress.push(address.subDistrict.name) - if (address?.district?.name) fullAddress.push(address.district.name) - if (address?.city?.name) fullAddress.push(address.city.name) + if (address?.subDistrict?.name) fullAddress.push(toTitleCase(address.subDistrict.name)) + if (address?.district?.name) fullAddress.push(toTitleCase(address.district.name)) + if (address?.city?.name) fullAddress.push(toTitleCase(address.city.name)) fullAddress = fullAddress.join(', ') return ( -- cgit v1.2.3 From bc04e721d51e149709ab3cfaf5e77ef034511860 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 27 Mar 2023 10:17:49 +0700 Subject: invoice, invoice detail, address, create address, edit address, wishlist --- .../elements/Navbar/NavbarUserDropdown.jsx | 2 +- src/lib/address/components/Addresses.jsx | 125 +++++--- src/lib/address/components/CreateAddress.jsx | 237 ++++++++-------- src/lib/address/components/EditAddress.jsx | 237 ++++++++-------- src/lib/auth/components/Menu.jsx | 2 +- src/lib/invoice/components/Invoice.jsx | 292 +++++++++++++++---- src/lib/invoice/components/Invoices.jsx | 313 +++++++++++++-------- src/lib/transaction/components/Transaction.jsx | 6 +- src/lib/transaction/components/Transactions.jsx | 18 +- src/lib/wishlist/components/Wishlists.jsx | 68 +++-- src/pages/my/address/[id]/edit.jsx | 20 +- src/pages/my/address/create.jsx | 17 +- src/pages/my/address/index.jsx | 17 +- src/pages/my/invoice/[id].jsx | 17 +- src/pages/my/invoices.jsx | 17 +- src/pages/my/wishlist.jsx | 17 +- 16 files changed, 888 insertions(+), 517 deletions(-) diff --git a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx index c08d81ce..1d2429a7 100644 --- a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx +++ b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx @@ -16,7 +16,7 @@ const NavbarUserDropdown = () => { Daftar Transaksi Invoice & Faktur Pajak Wishlist - Pengaturan Akun + Daftar Alamat diff --git a/src/lib/address/components/Addresses.jsx b/src/lib/address/components/Addresses.jsx index 3ac06b6c..a2adecb1 100644 --- a/src/lib/address/components/Addresses.jsx +++ b/src/lib/address/components/Addresses.jsx @@ -4,13 +4,15 @@ import useAuth from '@/core/hooks/useAuth' import { getItemAddress, updateItemAddress } from '@/core/utils/address' import { useRouter } from 'next/router' import useAddresses from '../hooks/useAddresses' +import MobileView from '@/core/components/views/MobileView' +import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' const Addresses = () => { const router = useRouter() const { select = null } = router.query - const auth = useAuth() const { addresses } = useAddresses() - const selectedAdress = getItemAddress(select || '') + const selectedAddress = getItemAddress(select || '') const changeSelectedAddress = (id) => { if (!select) return updateItemAddress(select, id) @@ -26,43 +28,96 @@ const Addresses = () => { } return ( -
-
- Tambah Alamat -
+ <> + +
+
+ Tambah Alamat +
+ +
+ {addresses.data?.map((address, index) => { + const type = address.type.charAt(0).toUpperCase() + address.type.slice(1) + ' Address' + return ( + + ) + })} +
+
+
-
- {addresses.data?.map((address, index) => { - let type = address.type.charAt(0).toUpperCase() + address.type.slice(1) + ' Address' - return ( -
-
changeSelectedAddress(address.id)}> -
-
{type}
- {auth?.partnerId == address.id &&
Utama
} -
-

{address.name}

- {address.mobile &&

{address.mobile}

} -

{address.street}

-
- - Ubah Alamat + +
+
+ +
+
+
+

Daftar Alamat

+ + Tambah Alamat
- ) - })} + +
+ {addresses.data?.map((address, index) => { + const type = + address.type.charAt(0).toUpperCase() + address.type.slice(1) + ' Address' + return ( + + ) + })} +
+
+
+
+ + ) +} + +const AddressCard = ({ address, selectedAddress, changeSelectedAddress, type, select }) => { + const auth = useAuth() + + return ( +
+
changeSelectedAddress(address.id)} className={select && 'cursor-pointer'}> +
+
{type}
+ {auth?.partnerId == address.id &&
Utama
} +
+

{address.name}

+ {address.mobile &&

{address.mobile}

} +

{address.street}

+ + Ubah Alamat +
) } diff --git a/src/lib/address/components/CreateAddress.jsx b/src/lib/address/components/CreateAddress.jsx index 849b4c01..475d8548 100644 --- a/src/lib/address/components/CreateAddress.jsx +++ b/src/lib/address/components/CreateAddress.jsx @@ -10,6 +10,7 @@ import { useEffect, useState } from 'react' import createAddressApi from '../api/createAddressApi' import { toast } from 'react-hot-toast' import { yupResolver } from '@hookform/resolvers/yup' +import Menu from '@/lib/auth/components/Menu' const CreateAddress = () => { const auth = useAuth() @@ -88,133 +89,119 @@ const CreateAddress = () => { } return ( -
-
- - ( - - )} - /> -
{errors.type?.message}
+
+
+
- -
- - -
{errors.name?.message}
-
- -
- - -
{errors.email?.message}
-
- -
- - -
{errors.mobile?.message}
-
- -
- - -
{errors.street?.message}
-
- -
- - -
{errors.zip?.message}
-
- -
- - ( - - )} - /> -
{errors.city?.message}
-
- -
- - ( - - )} - /> -
- -
- - ( - - )} - /> +
+ +
+
+ + ( + + )} + /> +
{errors.type?.message}
+
+ +
+ + +
{errors.name?.message}
+
+ +
+ + +
{errors.email?.message}
+
+ +
+ + +
{errors.mobile?.message}
+
+ +
+ + +
{errors.street?.message}
+
+ +
+ + +
{errors.zip?.message}
+
+ +
+ + } + /> +
{errors.city?.message}
+
+ +
+ + ( + + )} + /> +
+ +
+ + ( + + )} + /> +
+
+ + +
- - - +
) } diff --git a/src/lib/address/components/EditAddress.jsx b/src/lib/address/components/EditAddress.jsx index a832edbc..d754cbd9 100644 --- a/src/lib/address/components/EditAddress.jsx +++ b/src/lib/address/components/EditAddress.jsx @@ -9,6 +9,7 @@ import subDistrictApi from '../api/subDistrictApi' import editAddressApi from '../api/editAddressApi' import HookFormSelect from '@/core/components/elements/Select/HookFormSelect' import { toast } from 'react-hot-toast' +import Menu from '@/lib/auth/components/Menu' const EditAddress = ({ id, defaultValues }) => { const router = useRouter() @@ -102,133 +103,119 @@ const EditAddress = ({ id, defaultValues }) => { } return ( -
-
- - ( - - )} - /> -
{errors.type?.message}
+
+
+
- -
- - -
{errors.name?.message}
-
- -
- - -
{errors.email?.message}
-
- -
- - -
{errors.mobile?.message}
-
- -
- - -
{errors.street?.message}
-
- -
- - -
{errors.zip?.message}
-
- -
- - ( - - )} - /> -
{errors.city?.message}
-
- -
- - ( - - )} - /> -
- -
- - ( - - )} - /> +
+

Ubah Alamat

+ +
+
+ + ( + + )} + /> +
{errors.type?.message}
+
+ +
+ + +
{errors.name?.message}
+
+ +
+ + +
{errors.email?.message}
+
+ +
+ + +
{errors.mobile?.message}
+
+ +
+ + +
{errors.street?.message}
+
+ +
+ + +
{errors.zip?.message}
+
+ +
+ + } + /> +
{errors.city?.message}
+
+ +
+ + ( + + )} + /> +
+ +
+ + ( + + )} + /> +
+
+ +
- - - +
) } diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 3f2b2fb2..9a73609d 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -7,7 +7,7 @@ const Menu = () => { const routeStartWith = (route) => router.pathname.startsWith(route) return ( -
+
Menu
Daftar Transaksi diff --git a/src/lib/invoice/components/Invoice.jsx b/src/lib/invoice/components/Invoice.jsx index e34ad8c2..355f36e5 100644 --- a/src/lib/invoice/components/Invoice.jsx +++ b/src/lib/invoice/components/Invoice.jsx @@ -4,10 +4,34 @@ import { downloadInvoice, downloadTaxInvoice } from '../utils/invoices' import Divider from '@/core/components/elements/Divider/Divider' import VariantGroupCard from '@/lib/variant/components/VariantGroupCard' import currencyFormat from '@/core/utils/currencyFormat' +import MobileView from '@/core/components/views/MobileView' +import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' +import Link from '@/core/components/elements/Link/Link' +import Image from '@/core/components/elements/Image/Image' +import { createSlug } from '@/core/utils/slug' +import { useEffect, useState } from 'react' const Invoice = ({ id }) => { const { invoice } = useInvoice({ id }) + const [totalAmount, setTotalAmount] = useState(0) + const [totalDiscountAmount, setTotalDiscountAmount] = useState(0) + + useEffect(() => { + if (invoice?.data?.products) { + let calculateTotalAmount = 0 + let calculateTotalDiscountAmount = 0 + invoice.data.products.forEach((product) => { + calculateTotalAmount += product.price.price * product.quantity + calculateTotalDiscountAmount += + (product.price.price - product.price.priceDiscount) * product.quantity + }) + setTotalAmount(calculateTotalAmount) + setTotalDiscountAmount(calculateTotalDiscountAmount) + } + }, [invoice]) + if (invoice.isLoading) { return (
@@ -27,74 +51,226 @@ const Invoice = ({ id }) => { return ( invoice.data?.name && ( <> -
- {invoice.data?.name} - - {invoice.data?.amountResidual > 0 ? ( - Belum Lunas - ) : ( - Lunas - )} - - - {invoice.data?.purchaseOrderName || '-'} - - {invoice.data?.paymentTerm} - {invoice.data?.amountResidual > 0 && invoice.invoiceDate != invoice.invoiceDateDue && ( - - {invoice.data?.invoiceDateDue} + +
+ {invoice.data?.name} + + {invoice.data?.amountResidual > 0 ? ( + Belum Lunas + ) : ( + Lunas + )} + + + {invoice.data?.purchaseOrderName || '-'} + + + {invoice.data?.paymentTerm} - )} - {invoice.data?.sales} - {invoice.data?.invoiceDate} -
-

Invoice

- + {invoice.data?.amountResidual > 0 && invoice.invoiceDate != invoice.invoiceDateDue && ( + + {invoice.data?.invoiceDateDue} + + )} + {invoice.data?.sales} + {invoice.data?.invoiceDate} +
+

Invoice

+ +
+
+

Faktur Pajak

+ +
-
-

Faktur Pajak

- + + + +
Detail Penagihan
+ +
+ {address?.name} + {address?.email || '-'} + {address?.mobile || '-'} + {fullAddress}
-
- + + +
Detail Produk
+ +
+ +
+

Total Belanja

+

{currencyFormat(invoice.data?.amountTotal)}

+
+
+ + + +
+
+ +
+
+

Invoice & Faktur Pajak

+ +
+ {invoice?.data?.name} + {invoice?.data?.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} +
+ + + +
+
+
Tanggal Invoice
+
: {invoice?.data?.invoiceDate}
+ +
Purchase Order
+
+ :{' '} + +
+ +
Ketentuan Pembayaran
+
: {invoice?.data?.paymentTerm}
+
+
+
Nama Sales
+
: {invoice?.data?.sales}
+ +
Faktur Pajak
+
+ :{' '} + {invoice.data?.efaktur ? ( + + ) : ( + '-' + )} +
+
+
-
Detail Penagihan
+
Rincian Pembelian
+
No. Transaksi
+ + + + + + + + + + + {invoice?.data?.products?.map((product) => ( + + + + + + + + ))} + +
Nama ProdukJumlahHargaDiskonSubtotal
+ + {product?.name} + +
+ + {product?.parent?.name} + +
+ {product?.code}{' '} + {product?.attributes.length > 0 + ? `| ${product?.attributes.join(', ')}` + : ''} +
+
+
{product.quantity}{currencyFormat(product.price.price)} + {product.price.discountPercentage > 0 + ? `${product.price.discountPercentage}%` + : ''} + {currencyFormat(product.price.priceDiscount * product.quantity)}
-
- {address?.name} - {address?.email || '-'} - {address?.mobile || '-'} - {fullAddress} -
+
+
+
Subtotal
+
{currencyFormat(totalAmount)}
- +
Total Diskon
+
+ {currencyFormat(-totalDiscountAmount)} +
-
Detail Produk
+
PPN 11% (Incl.)
+
{currencyFormat(totalAmount * 0.11)}
-
- -
-

Total Belanja

-

{currencyFormat(invoice.data?.amountTotal)}

+
Grand Total
+
+ {currencyFormat(invoice.data?.amountTotal)} +
+
+
+
-
+ ) ) diff --git a/src/lib/invoice/components/Invoices.jsx b/src/lib/invoice/components/Invoices.jsx index ab318a3c..51041316 100644 --- a/src/lib/invoice/components/Invoices.jsx +++ b/src/lib/invoice/components/Invoices.jsx @@ -16,6 +16,9 @@ import Link from '@/core/components/elements/Link/Link' import currencyFormat from '@/core/utils/currencyFormat' import BottomPopup from '@/core/components/elements/Popup/BottomPopup' import { downloadInvoice, downloadTaxInvoice } from '../utils/invoices' +import MobileView from '@/core/components/views/MobileView' +import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' const Invoices = () => { const router = useRouter() @@ -44,133 +47,201 @@ const Invoices = () => { } return ( -
-
- setInputQuery(e.target.value)} - /> - -
- - {invoices.isLoading && ( -
- -
- )} - - {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( - - Tidak ada data invoice - - )} - - {invoices.data?.invoices?.map((invoice, index) => ( -
-
- - No. Invoice -

{invoice.name}

- -
- {invoice.amountResidual > 0 ? ( -
Belum Lunas
- ) : ( -
Lunas
- )} - setToOthers(invoice)} - /> -
-
- -
-

{invoice.invoiceDate}

-

{invoice.paymentTerm}

+ <> + +
+
+ setInputQuery(e.target.value)} + /> + +
+ + {invoices.isLoading && ( +
+
-
-
-
- No. Purchase Order -

- {invoice.purchaseOrderName || '-'} -

-
-
- Total Invoice -

- {currencyFormat(invoice.amountTotal)} -

+ )} + + {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( + + Tidak ada data invoice + + )} + + {invoices.data?.invoices?.map((invoice, index) => ( +
+
+ + No. Invoice +

{invoice.name}

+ +
+ {invoice.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} + setToOthers(invoice)} /> +
+ +
+

{invoice.invoiceDate}

+

{invoice.paymentTerm}

+
+
+
+
+ No. Purchase Order +

+ {invoice.purchaseOrderName || '-'} +

+
+
+ Total Invoice +

+ {currencyFormat(invoice.amountTotal)} +

+
+
+ + {invoice.efaktur ? ( +
+ + Faktur Pajak +
+ ) : ( +
+ + Faktur Pajak +
+ )}
- - {invoice.efaktur ? ( -
- - Faktur Pajak -
- ) : ( -
- - Faktur Pajak + ))} + + + + setToOthers(null)}> +
+ +
- )} +
- ))} - - - - setToOthers(null)} - > -
- - + + + +
+
+ +
+
+
+

+ Invoice & Faktur Pajak{' '} + {invoices?.data?.invoices ? `(${invoices?.data?.invoices.length})` : ''} +

+
+ setInputQuery(e.target.value)} + /> + +
+
+ + + + + + + + + + + + + + {invoices.isLoading && ( + + + + )} + {!invoices.isLoading && + (!invoices?.data?.invoices || invoices?.data?.invoices?.length == 0) && ( + + + + )} + {invoices.data?.invoices?.map((invoice) => ( + + + + + + + + + ))} + +
No. InvoiceNo. POTanggalSalespersonStatusTotal
+
+ +
+
Tidak ada data invoice
+ {invoice.name} + {invoice.purchaseOrderName || '-'}{invoice.invoiceDate}{invoice.sales} + {invoice.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} +
{currencyFormat(invoice.amountTotal)}
+ + +
- -
+ + ) } diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index cba7646f..104a7f2d 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -298,14 +298,14 @@ const Transaction = ({ id }) => {
-
+
Nama Sales
: {transaction?.data?.sales}
Tanggal Transaksi
: {transaction?.data?.dateOrder}
-
+
Ketentuan Pembayaran
: {transaction?.data?.paymentTerm}
@@ -398,7 +398,7 @@ const Transaction = ({ id }) => { ? `${product.price.discountPercentage}%` : ''} - {currencyFormat(product.price.priceDiscount)} + {currencyFormat(product.price.priceDiscount * product.quantity)} ))} diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index 0a772967..30c670ae 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -224,12 +224,28 @@ const Transactions = () => { No. Transaksi Tanggal - Sales Person + Salesperson Total Status + {transactions.isLoading && ( + + +
+ +
+ + + )} + {!transactions.isLoading && + (!transactions?.data?.saleOrders || + transactions?.data?.saleOrders?.length == 0) && ( + + Tidak ada data transaksi + + )} {transactions.data?.saleOrders?.map((saleOrder) => ( diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx index e61efcc3..e13c61e5 100644 --- a/src/lib/wishlist/components/Wishlists.jsx +++ b/src/lib/wishlist/components/Wishlists.jsx @@ -4,6 +4,9 @@ import Spinner from '@/core/components/elements/Spinner/Spinner' import ProductCard from '@/lib/product/components/ProductCard' import { useRouter } from 'next/router' import useWishlists from '../hooks/useWishlists' +import MobileView from '@/core/components/views/MobileView' +import DesktopView from '@/core/components/views/DesktopView' +import Menu from '@/lib/auth/components/Menu' const Wishlists = () => { const router = useRouter() @@ -22,33 +25,46 @@ const Wishlists = () => { } return ( -
- {wishlists.data?.products?.length == 0 && ( - - Wishlist anda masih kosong - - )} - -
- {wishlists.data?.products.map((product) => ( - - ))} -
+ <> + +
+ {wishlists.data?.products?.length == 0 && ( + + Wishlist anda masih kosong + + )} -
- -
-
+
+ {wishlists.data?.products.map((product) => ( + + ))} +
+ +
+ +
+
+ + + +
+
+ +
+
+
+ {wishlists.data?.products.map((product) => ( + + ))} +
+ +
+ +
+
+
+
+ ) } diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx index bc5f3471..6706b458 100644 --- a/src/pages/my/address/[id]/edit.jsx +++ b/src/pages/my/address/[id]/edit.jsx @@ -1,4 +1,7 @@ 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 addressApi from '@/lib/address/api/addressApi' import EditAddressComponent from '@/lib/address/components/EditAddress' import IsAuth from '@/lib/auth/components/IsAuth' @@ -6,12 +9,17 @@ 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 ec17f987..be645853 100644 --- a/src/pages/my/address/create.jsx +++ b/src/pages/my/address/create.jsx @@ -1,13 +1,24 @@ 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 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 93ed40b0..61d72a41 100644 --- a/src/pages/my/address/index.jsx +++ b/src/pages/my/address/index.jsx @@ -1,13 +1,24 @@ 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 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 4938d8f8..740819cc 100644 --- a/src/pages/my/invoice/[id].jsx +++ b/src/pages/my/invoice/[id].jsx @@ -1,4 +1,7 @@ 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 IsAuth from '@/lib/auth/components/IsAuth' import InvoiceComponent from '@/lib/invoice/components/Invoice' import { useRouter } from 'next/router' @@ -8,9 +11,17 @@ export default function Invoice() { return ( - - - + + + + + + + + + + + ) } diff --git a/src/pages/my/invoices.jsx b/src/pages/my/invoices.jsx index 12a5ff7e..59059b2e 100644 --- a/src/pages/my/invoices.jsx +++ b/src/pages/my/invoices.jsx @@ -1,13 +1,24 @@ 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 IsAuth from '@/lib/auth/components/IsAuth' import InvoicesComponent from '@/lib/invoice/components/Invoices' export default function Invoices() { return ( - - - + + + + + + + + + + + ) } diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx index 196adf50..7d9ad0d7 100644 --- a/src/pages/my/wishlist.jsx +++ b/src/pages/my/wishlist.jsx @@ -1,13 +1,24 @@ 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 IsAuth from '@/lib/auth/components/IsAuth' import Wishlists from '@/lib/wishlist/components/Wishlists' export default function Wishlist() { return ( - - - + + + + + + + + + + + ) } -- cgit v1.2.3