summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-29 14:11:23 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-29 14:11:23 +0700
commit0dab223d410e1c6011bfb4e1e850dfe566c8d044 (patch)
tree5c938bc5944deaa192f0ab4215d96f311b37dd4f /src
parent60f0b9d33335719b15f60f4b99bd80a48b7da346 (diff)
add params etd di checkout
Diffstat (limited to 'src')
-rw-r--r--src/lib/checkout/components/Checkout.jsx18
-rw-r--r--src/lib/shipment/components/Shipments.jsx4
-rw-r--r--src/pages/my/menu.jsx53
3 files changed, 66 insertions, 9 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index afb94c10..0eb05345 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -297,10 +297,12 @@ const Checkout = () => {
order_line: JSON.stringify(productOrder),
delivery_amount: biayaKirim,
carrier_id: selectedCarrierId,
+ estimated_arrival_days: splitDuration(etd),
delivery_service_type: selectedExpedisiService,
voucher: activeVoucher,
type: 'sale_order'
}
+
if (query) {
data.source = 'buy'
}
@@ -1444,6 +1446,22 @@ function calculateEstimatedArrival(duration) {
return ''
}
+function splitDuration(duration){
+ if (duration) {
+ let estimationDate = null
+ if (duration.includes('-')){
+ estimationDate = duration.split('-')
+ estimationDate = parseInt(estimationDate[1])
+ }else{
+ estimationDate = parseInt(duration)
+ }
+
+ return estimationDate
+ }
+
+ return ''
+}
+
const extractDuration = (text) => {
const matches = text.match(/\d+(?:-\d+)?/g)
diff --git a/src/lib/shipment/components/Shipments.jsx b/src/lib/shipment/components/Shipments.jsx
index d62afcb7..c9d3e627 100644
--- a/src/lib/shipment/components/Shipments.jsx
+++ b/src/lib/shipment/components/Shipments.jsx
@@ -144,8 +144,8 @@ const Shipments = () => {
onClick={() => setIdAWB(shipment.id)}
className='flex items-center mt-1 gap-x-1 min-w-full'
>
- <ImageNext src={`/images/BOX_DELIVER_(1).svg`} width={20} height={20} />
- <p className='text-sm text-green-600 truncate'>
+ <ImageNext src={`/images/BOX_DELIVERY_GREEN.svg`} width={20} height={20} />
+ <p className='text-sm text-green-700 truncate'>
{shipment.lastManifest.description}
</p>
<p className='ml-auto'>{'>'}</p>
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index 8d209fba..124c87c9 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -6,6 +6,7 @@ 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'
+import ImageNext from 'next/image'
export default function Menu() {
const auth = useAuth()
@@ -40,11 +41,38 @@ export default function Menu() {
<MenuHeader>Aktivitas Pembelian</MenuHeader>
<div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
- <LinkItem href='/my/quotations'>Daftar Quotation</LinkItem>
- <LinkItem href='/my/transactions'>Daftar Transaksi</LinkItem>
- <LinkItem href='/my/shipments'>Daftar Pengiriman</LinkItem>
- <LinkItem href='/my/invoices'>Invoice & Faktur Pajak</LinkItem>
- <LinkItem href='/my/wishlist'>Wishlist</LinkItem>
+ <LinkItem href='/my/quotations'>
+ {' '}
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_daftar_quotation.svg' width={18} height={20} />
+ <p>Daftar Quotation</p>
+ </div>
+ </LinkItem>
+ <LinkItem href='/my/transactions'>
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_daftar_transaksi.svg' width={18} height={20} />
+ <p>Daftar Transaksi</p>
+ </div>
+ </LinkItem>
+ <LinkItem href='/my/shipments'>
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_pengiriman.svg' width={18} height={20} />
+ <p>Daftar Pengiriman</p>
+ </div>
+ </LinkItem>
+ <LinkItem href='/my/invoices'>
+ {' '}
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_invoice.svg' width={18} height={20} />
+ <p>Invoice & Faktur Pajak</p>
+ </div>
+ </LinkItem>
+ <LinkItem href='/my/wishlist'>
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_wishlist.svg' width={18} height={20} />
+ <p>Wishlist</p>
+ </div>
+ </LinkItem>
</div>
</div>
@@ -52,7 +80,13 @@ export default function Menu() {
<MenuHeader>Pusat Bantuan</MenuHeader>
<div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
- <LinkItem href='/'>Layanan Pelanggan</LinkItem>
+ <LinkItem href='/'>
+ {' '}
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_layanan_pelanggan.svg' width={18} height={20} />
+ <p>Layanan Pelanggan</p>
+ </div>
+ </LinkItem>
</div>
</div>
@@ -60,7 +94,12 @@ export default function Menu() {
<MenuHeader>Pengaturan Akun</MenuHeader>
<div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
- <LinkItem href='/my/address'>Daftar Alamat</LinkItem>
+ <LinkItem href='/my/address'>
+ <div className='flex gap-x-3 items-center'>
+ <ImageNext src='/images/icon/icon_daftar_alamat.svg' width={18} height={20} />
+ <p>Daftar Alamat</p>
+ </div>
+ </LinkItem>
</div>
<div onClick={logout} className='p-4 mt-2'>