summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-migrate/modules/cart/components/Item.tsx8
-rw-r--r--src-migrate/pages/shop/cart/index.tsx22
-rw-r--r--src-migrate/types/cart.ts3
3 files changed, 25 insertions, 8 deletions
diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx
index a3aa2ac2..3a02d37c 100644
--- a/src-migrate/modules/cart/components/Item.tsx
+++ b/src-migrate/modules/cart/components/Item.tsx
@@ -15,6 +15,8 @@ import CartItemAction from './ItemAction';
import CartItemPromo from './ItemPromo';
import CartItemSelect from './ItemSelect';
+import { BadgePercent } from 'lucide-react';
+
type Props = {
item: CartItemProps;
editable?: boolean;
@@ -80,6 +82,12 @@ const CartItem = ({ item, editable = true, selfPicking }: Props) => {
</div>
)}
<CartItem.Name item={item} />
+ {item.cart_type === 'product' && item.voucher_pasti_hemat && (
+ <span className={style.voucherBadge}>
+ <BadgePercent size={14} />
+ Bisa pakai voucher pasti hemat
+ </span>
+ )}
<div className='mt-2 flex justify-between w-full'>
<div className='flex flex-col gap-y-1'>
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx
index 031aa45b..5121c732 100644
--- a/src-migrate/pages/shop/cart/index.tsx
+++ b/src-migrate/pages/shop/cart/index.tsx
@@ -301,14 +301,19 @@ const CartPage: React.FC = () => {
<>
{/* Sticky Header */}
<div
- className={`${isTop ? 'border-b-[0px]' : 'border-b-[1px]'
- } sticky md:top-[157px] flex-col bg-white py-4 border-gray-300 z-50 sm:w-full md:w-3/4`}
+ className={`${
+ isTop ? 'border-b-[0px]' : 'border-b-[1px]'
+ } sticky md:top-[157px] flex-col bg-white py-4 border-gray-300 z-50 sm:w-full md:w-3/4`}
>
<div className='flex items-center justify-between mb-2'>
<h1 className={style.title}>Keranjang Belanja</h1>
</div>
- <div className='h-2' />
+ <div className='inline-flex items-center border border-green-500 p-2 bg-green-50 rounded-md mb-2'>
+ <span className='text-sm font-semibold text-green-700'>
+ Gunakan Voucher `VoucherPastiHemat` untuk belanja lebih hemat.
+ </span>
+ </div>
<div className='flex items-center object-center justify-between flex-wrap gap-2'>
<div className='flex items-center object-center'>
<Checkbox
@@ -392,16 +397,19 @@ const CartPage: React.FC = () => {
</div>
<div
- className="md:hidden"
- style={{ height: 'calc(var(--mobile-actions-h) + var(--mobile-total-h))' }}
+ className='md:hidden'
+ style={{
+ height: 'calc(var(--mobile-actions-h) + var(--mobile-total-h))',
+ }}
/>
{/* Cart Summary */}
<div
- className={`${style['summary-wrapper']} ${device.isMobile && (!cart || cart?.product_total === 0)
+ className={`${style['summary-wrapper']} ${
+ device.isMobile && (!cart || cart?.product_total === 0)
? 'hidden'
: ''
- }`}
+ }`}
>
<div className={style.summary}>
{device.isMobile ? (
diff --git a/src-migrate/types/cart.ts b/src-migrate/types/cart.ts
index 05fdcadb..fbf7c3f5 100644
--- a/src-migrate/types/cart.ts
+++ b/src-migrate/types/cart.ts
@@ -1,4 +1,4 @@
-import { CategoryPromo } from "./promotion";
+import { CategoryPromo } from './promotion';
type Price = {
price: number;
@@ -37,6 +37,7 @@ export type CartItem = {
available_quantity: number;
weight: number;
attributes: string[];
+ voucher_pasti_hemat?: boolean;
parent: {
id: number;
name: string;