This commit is contained in:
shafi54 2026-08-23 20:06:25 +05:30
parent cf83857fd4
commit 8e9c41bfa4
7 changed files with 153 additions and 15 deletions

View file

@ -23,7 +23,7 @@
- When updating or creating a document, prefers the agent first compare it against existing source documents, identify missing items or gaps, and add them in the same established format. Confidence: 0.9 - When updating or creating a document, prefers the agent first compare it against existing source documents, identify missing items or gaps, and add them in the same established format. Confidence: 0.9
- Dislikes nested headers in mobile/drawer navigation; prefers a single, shared header (e.g., the drawer header) and relies on device back buttons or gestures for returning to previous screens. Confidence: 0.9 - Dislikes nested headers in mobile/drawer navigation; prefers a single, shared header (e.g., the drawer header) and relies on device back buttons or gestures for returning to previous screens. Confidence: 0.9
- After reviewing a presented plan, prefers brief, action-oriented approval (e.g., "nice. go ahead", "go ahead and implement") before implementation proceeds, expecting the agent to autonomously execute the already-presented plan. Confidence: 0.85 - After reviewing a presented plan, prefers brief, action-oriented approval (e.g., "nice. go ahead", "go ahead and implement") before implementation proceeds, expecting the agent to autonomously execute the already-presented plan. Confidence: 0.85
- Wants feature parity maintained between the web-ui and user-ui apps (port logic/data patterns, rebuild UI per platform). Confidence: 0.95 - Wants feature parity maintained between the web-ui and user-ui apps (port logic/data patterns, rebuild UI per platform) — e.g., when he asks for a link in the cart page "at the coupons section" of @apps/user-ui/components/cart-page.tsx, he means mirror user-ui's coupons section (card, header, icon) in web-ui and add the requested link there; and conversely asks for features added in one app to be added to the sibling app "too" (e.g., "add the coupon redirection on the user-ui cart-page too"), expecting the agent to locate the equivalent component/route and replicate it. Confidence: 0.98
- Wants the web-ui home page section/component order to match the reference user-ui home page exactly (e.g., "on the home page have the order same as that of @apps/user-ui/.../home/index.tsx"), including when deciding placement of sections like Explore, Stores, Slots, and All Products. Confidence: 0.7 - Wants the web-ui home page section/component order to match the reference user-ui home page exactly (e.g., "on the home page have the order same as that of @apps/user-ui/.../home/index.tsx"), including when deciding placement of sections like Explore, Stores, Slots, and All Products. Confidence: 0.7
- Wants brand/logo spots to use the single real brand logo asset (shared across apps, e.g., the Freshyo splash logo) displayed as an image, not a generic/decorative icon (e.g., a "meat piece" Meat/Beef icon) — web-ui should be on par with user-ui and show the same logo; applies to favicon, PWA icons, and every in-UI branding spot (sidebar, topbar, login, home banner). Confidence: 0.85 - Wants brand/logo spots to use the single real brand logo asset (shared across apps, e.g., the Freshyo splash logo) displayed as an image, not a generic/decorative icon (e.g., a "meat piece" Meat/Beef icon) — web-ui should be on par with user-ui and show the same logo; applies to favicon, PWA icons, and every in-UI branding spot (sidebar, topbar, login, home banner). Confidence: 0.85
- Prefers dead-code audits to be documented in a markdown file. Confidence: 0.8 - Prefers dead-code audits to be documented in a markdown file. Confidence: 0.8
@ -54,9 +54,9 @@ er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the
- Tracks previously discussed/planned fixes and follows up to verify they were actually applied (e.g., "did we take care of the math.trunc"); expects the agent to check the current state of the code and apply any outstanding planned changes rather than assume they were completed. Confidence: 0.8 - Tracks previously discussed/planned fixes and follows up to verify they were actually applied (e.g., "did we take care of the math.trunc"); expects the agent to check the current state of the code and apply any outstanding planned changes rather than assume they were completed. Confidence: 0.8
- Prevents contradictory/invalid states in admin forms by hiding the inapplicable control entirely — including its label/text row — rather than leaving it visible but disabled (e.g., the entire "Combo Only SKU" checkbox row is hidden when the SKU itself is a combo — has combo items — not just disabled). Confidence: 0.6 - Prevents contradictory/invalid states in admin forms by hiding the inapplicable control entirely — including its label/text row — rather than leaving it visible but disabled (e.g., the entire "Combo Only SKU" checkbox row is hidden when the SKU itself is a combo — has combo items — not just disabled). Confidence: 0.6
- Wants savings figures kept consistent across all order surfaces: a savings concept shown in the cart/checkout bill (market price offered price) must also be reflected in the order confirmation summary ("you saved n on this order"), aggregating all savings sources (coupon discount, market-price savings, free delivery) rather than only the coupon/discount component. Confidence: 0.85 - Wants savings figures kept consistent across all order surfaces: a savings concept shown in the cart/checkout bill (market price offered price) must also be reflected in the order confirmation summary ("you saved n on this order"), aggregating all savings sources (coupon discount, market-price savings, free delivery) rather than only the coupon/discount component. Confidence: 0.85
- Cares about the exact user-facing wording of labels and explicitly dictates renames (e.g., "Total Savings" → "Total Discount" on the cart page), expecting the change to be applied exactly as specified. Confidence: 0.7 - Cares about the exact user-facing wording of labels and explicitly dictates renames (e.g., "Total Savings" → "Total Discount" on the cart page), expecting the change to be applied exactly as specified — including new labels dictated verbatim in the request (e.g., a link literally named "Add Coupons to account", a button that "should say Add Multiple", not paraphrased). Confidence: 0.8
- When a button/feature is broken on one page but works on a sibling page (e.g., "Edit Notes" in the order-list three-dot menu vs. the order detail page), expects it fixed to behave like the working page — including calling the proper API with the correct parameter types (numeric order id matching the backend's zod schema, not a stringified id) rather than a no-op or wrong call. Confidence: 0.7 - When a button/feature is broken on one page but works on a sibling page (e.g., "Edit Notes" in the order-list three-dot menu vs. the order detail page), expects it fixed to behave like the working page — including calling the proper API with the correct parameter types (numeric order id matching the backend's zod schema, not a stringified id) rather than a no-op or wrong call. Confidence: 0.7
- Reports UI bugs by pointing at the specific file and describing the intended action plus the visible symptom (e.g., "submit not happening"), often with a hypothesis about the cause ("maybe we're not fulfilling conditions to enable"); expects the agent to trace the validation/submit path and find the root cause rather than just making the UI appear to work. Confidence: 0.6 - Reports UI bugs by pointing at the specific file and describing the intended action plus the visible symptom (e.g., "submit not happening", "I see [id]/index instead of product name in the top bar"), often with a hypothesis about the cause ("maybe we're not fulfilling conditions to enable"); expects the agent to trace the actual code path and find the root cause rather than just making the UI appear to work. Confidence: 0.65
- Expects form validation and submit-enable conditions to match the current UI mode: fields hidden by a mode toggle (e.g., the single coupon-code field when "reserved coupon" is selected) must not be required, and discount-type toggles should not pre-fill placeholder values (like 0) that fail the `> 0` validation — hidden/placeholder state must never block submission. Confidence: 0.55 - Expects form validation and submit-enable conditions to match the current UI mode: fields hidden by a mode toggle (e.g., the single coupon-code field when "reserved coupon" is selected) must not be required, and discount-type toggles should not pre-fill placeholder values (like 0) that fail the `> 0` validation — hidden/placeholder state must never block submission. Confidence: 0.55
- On mobile screens, prefers abbreviated button labels to conserve horizontal space — e.g., the add-to-cart button shows just the cart icon + "Add" on mobile and the full "Add to Cart" label from the `md` breakpoint up ("if the screen is mobile one just show cart symbol and Add instead of Add to cart"), implemented with responsive `md:hidden` / `hidden md:inline` spans. Confidence: 0.8 - On mobile screens, prefers abbreviated button labels to conserve horizontal space — e.g., the add-to-cart button shows just the cart icon + "Add" on mobile and the full "Add to Cart" label from the `md` breakpoint up ("if the screen is mobile one just show cart symbol and Add instead of Add to cart"), implemented with responsive `md:hidden` / `hidden md:inline` spans. Confidence: 0.8
- Expects the UI to reflect state changes immediately after an action, without a manual page refresh — e.g., items added to the cart must show up in the cart/badge right away; reports staleness bugs as "added items are not visible unless page is refreshed. They are added but not shown in cart," distinguishing that data was persisted (localStorage) but the UI didn't update. Confidence: 0.7 - Expects the UI to reflect state changes immediately after an action, without a manual page refresh — e.g., items added to the cart must show up in the cart/badge right away; reports staleness bugs as "added items are not visible unless page is refreshed. They are added but not shown in cart," distinguishing that data was persisted (localStorage) but the UI didn't update. Confidence: 0.7
@ -83,6 +83,11 @@ er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the
- Prefers a lighter, more compact look for product-card text: the product name rendered at `font-medium` (not `font-bold`) and the card's content padding tightened (e.g., `px-3 pt-2.5 pb-2.5` instead of `px-4 pt-3 pb-3`) — explicit instruction: "for the text of product name, reduce the weight and it's padding." He then continued tightening the horizontal padding by directly dictating the value ("make the padding px-1.5"), so expects the agent to apply exact spacing values he specifies. Confidence: 0.7 - Prefers a lighter, more compact look for product-card text: the product name rendered at `font-medium` (not `font-bold`) and the card's content padding tightened (e.g., `px-3 pt-2.5 pb-2.5` instead of `px-4 pt-3 pb-3`) — explicit instruction: "for the text of product name, reduce the weight and it's padding." He then continued tightening the horizontal padding by directly dictating the value ("make the padding px-1.5"), so expects the agent to apply exact spacing values he specifies. Confidence: 0.7
- Prefers secondary/informational product-card text (e.g., the quantity line) in the brand color at 70% opacity (`text-brand-700/70`) rather than muted gray — "show the quantity in the branch [brand] color 70% opacity" — the same `text-brand-700/70` treatment he chose for the delivery-date line, suggesting a recurring card-text color treatment for secondary info. When the line carries a label prefix (e.g., "Qty:"), only the VALUE part gets the brand color; the label stays muted gray and the value gets a touch more weight (`font-semibold`) to stand out — "only the value part. not the 'Qty'". Confidence: 0.7 - Prefers secondary/informational product-card text (e.g., the quantity line) in the brand color at 70% opacity (`text-brand-700/70`) rather than muted gray — "show the quantity in the branch [brand] color 70% opacity" — the same `text-brand-700/70` treatment he chose for the delivery-date line, suggesting a recurring card-text color treatment for secondary info. When the line carries a label prefix (e.g., "Qty:"), only the VALUE part gets the brand color; the label stays muted gray and the value gets a touch more weight (`font-semibold`) to stand out — "only the value part. not the 'Qty'". Confidence: 0.7
- During product-card decluttering passes, wants promo/discount badges (e.g., the "n% OFF" label) hidden too — prefers a clean, uncluttered product card with no discount badge overlays ("hide the n% off label too"), the same treatment previously applied to hiding the delivery-date block. Confidence: 0.6 - During product-card decluttering passes, wants promo/discount badges (e.g., the "n% OFF" label) hidden too — prefers a clean, uncluttered product card with no discount badge overlays ("hide the n% off label too"), the same treatment previously applied to hiding the delivery-date block. Confidence: 0.6
- Prefers bottom-sheet dialogs (the app's `BottomDialog`) for collecting simple input values (e.g., a count for bulk coupon generation) rather than separate screens or inline form sections — explicitly requested "it should open a bottom dialog and should take input of the desired count". Confidence: 0.4
- Expects newly generated/derived data to be merged into existing state structures rather than managed separately — e.g., bulk-generated coupon codes appended to the existing `couponCodes` array because "we already have coupon codes as array". Confidence: 0.5
- Expects back navigation in the mobile app to return to the screen he navigated from, not to an unrelated tab root — when a link from the cart page to the coupons page (which lives in another tab's stack) made pressing back land on the "Me" page instead of the cart, he reported it as a bug ("when I try to press back I don't come to the cart page again. I come to me page. why is that"); cross-tab navigation flows must preserve a way back to the origin screen. Confidence: 0.6
- When the same screen can be reached from multiple entry points, wants its UI to adapt based on the entry point — e.g., the coupons page opened from the cart page (via a `?from=cart` param) should hide the bottom tab bar while focused and restore it on leaving, while the same page opened from its own tab keeps the tab bar visible ("if coupons page is accessed from cart page, I want to hide the bottom nav bar"). Confidence: 0.7
- For bulk/sequential generation from a code pattern (e.g., ABC12 → ABC13...), expects numbering to continue from the HIGHEST existing value so regeneration never re-emits already-entered codes — after entering ABC12, the next batch must start at ABC13, not restart at 12 (the first matching code). Confidence: 0.6
e changes. Confidence: 0.95 e changes. Confidence: 0.95
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9 er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9
als) rather than introducing new brand palettes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95 als) rather than introducing new brand palettes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95
@ -90,3 +95,6 @@ roducing new brand palettes; approval of a redesign's layout/composition does no
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9 er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9
tes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95 tes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9 er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9
y, including details like item counts and container styling. Confidence: 0.9
tes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9

View file

@ -80,6 +80,10 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
const [hasMoreUsers, setHasMoreUsers] = useState(true); const [hasMoreUsers, setHasMoreUsers] = useState(true);
const [usersDropdownOpen, setUsersDropdownOpen] = useState(false); const [usersDropdownOpen, setUsersDropdownOpen] = useState(false);
// Add-multiple dialog states (for pattern codes like ABC12)
const [multiDialogOpen, setMultiDialogOpen] = useState(false);
const [multiCount, setMultiCount] = useState('');
const { data: usersData, isFetching: isFetchingUsers } = trpc.admin.coupon.getUsersMiniInfo.useQuery( const { data: usersData, isFetching: isFetchingUsers } = trpc.admin.coupon.getUsersMiniInfo.useQuery(
{ search: userSearchQuery, limit: USERS_PAGE_SIZE, offset: userOffset }, { search: userSearchQuery, limit: USERS_PAGE_SIZE, offset: userOffset },
{ enabled: usersDropdownOpen } { enabled: usersDropdownOpen }
@ -152,6 +156,34 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
const isReserved = (values as any).isReservedCoupon; const isReserved = (values as any).isReservedCoupon;
// Detect pattern codes like ABC12 (ends in digits) for bulk generation.
// Continue numbering from the highest code with the same prefix.
const patternCode = (values.couponCodes || []).find(
(c: string) => /^[A-Z0-9_-]*\d+$/.test(c.trim())
);
const patternPrefix = patternCode ? patternCode.replace(/\d+$/, '') : '';
const patternStart = (values.couponCodes || []).reduce((max, c) => {
const trimmed = c.trim();
if (!patternPrefix || !trimmed.startsWith(patternPrefix)) return max;
const m = trimmed.match(/\d+$/);
if (!m) return max;
return Math.max(max, parseInt(m[0], 10));
}, patternCode ? parseInt((patternCode.match(/\d+$/) || ['0'])[0], 10) : 0);
const handleAddMultiple = () => {
const count = parseInt(multiCount, 10);
if (!count || count < 1 || count > 100) return;
// Start from the next number after the highest existing code
const newCodes = Array.from(
{ length: count },
(_, i) => `${patternPrefix}${patternStart + 1 + i}`
);
const existing = (values.couponCodes || []).filter((c: string) => c && c.trim());
setFieldValue('couponCodes', [...existing, ...newCodes]);
setMultiDialogOpen(false);
setMultiCount('');
};
return ( return (
<AppContainer> <AppContainer>
{/* Is Reserved Coupon Checkbox */} {/* Is Reserved Coupon Checkbox */}
@ -206,12 +238,23 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
{(errors.couponCodes as any)?.message && ( {(errors.couponCodes as any)?.message && (
<Text style={tw`text-red-500 text-xs mb-2`}>{(errors.couponCodes as any).message}</Text> <Text style={tw`text-red-500 text-xs mb-2`}>{(errors.couponCodes as any).message}</Text>
)} )}
<View style={tw`mt-2 flex-row self-start`}>
<TouchableOpacity <TouchableOpacity
onPress={() => setFieldValue('couponCodes', [...(values.couponCodes || []), ''])} onPress={() => setFieldValue('couponCodes', [...(values.couponCodes || []), ''])}
style={tw`mt-2 py-2 px-3 bg-blue-50 rounded-lg border border-blue-200 self-start`} style={tw`py-2 px-3 bg-blue-50 rounded-lg border border-blue-200`}
> >
<Text style={tw`text-blue-600 font-medium`}>+ Add Code</Text> <Text style={tw`text-blue-600 font-medium`}>+ Add Code</Text>
</TouchableOpacity> </TouchableOpacity>
{patternCode && (
<TouchableOpacity
onPress={() => setMultiDialogOpen(true)}
style={tw`ml-2 py-2 px-3 bg-green-50 rounded-lg border border-green-200`}
>
<Text style={tw`text-green-600 font-medium`}>Add Multiple</Text>
</TouchableOpacity>
)}
</View>
</View> </View>
{/* Discount Type Selection */} {/* Discount Type Selection */}
@ -425,7 +468,39 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
</View> </View>
</BottomDialog> </BottomDialog>
{/* Add Multiple Coupons Dialog */}
<BottomDialog open={multiDialogOpen} onClose={() => setMultiDialogOpen(false)}>
<View style={tw`p-4`}>
<Text style={tw`text-lg font-semibold mb-1`}>Add Multiple Coupons</Text>
<Text style={tw`text-sm text-gray-500 mb-4`}>
Generate {patternCode ? `${patternPrefix}${patternStart + 1}, ${patternPrefix}${patternStart + 2}, ...` : 'sequential'} codes from your pattern
</Text>
<MyTextInput
topLabel="How many?"
placeholder="e.g., 10"
value={multiCount}
onChangeText={setMultiCount}
keyboardType="numeric"
/>
<View style={tw`flex-row mt-4`}>
<TouchableOpacity
onPress={() => {
setMultiDialogOpen(false);
setMultiCount('');
}}
style={tw`flex-1 p-3 rounded bg-gray-100 mr-2`}
>
<Text style={tw`text-gray-700 text-center font-semibold`}>Cancel</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={handleAddMultiple}
style={tw`flex-1 p-3 rounded bg-green-500`}
>
<Text style={tw`text-white text-center font-semibold`}>Generate</Text>
</TouchableOpacity>
</View>
</View>
</BottomDialog>

View file

@ -1,6 +1,8 @@
import { Stack } from 'expo-router'; import { Stack, useLocalSearchParams } from 'expo-router';
export default function CouponsLayout() { export default function CouponsLayout() {
const { from } = useLocalSearchParams<{ from?: string }>();
return ( return (
<Stack> <Stack>
<Stack.Screen <Stack.Screen
@ -8,6 +10,7 @@ export default function CouponsLayout() {
options={{ options={{
title: 'My Coupons', title: 'My Coupons',
headerShown: true, headerShown: true,
headerBackVisible: from !== 'cart',
}} }}
/> />
</Stack> </Stack>

View file

@ -1,6 +1,9 @@
import React, { useState } from 'react'; import React, { useState, useCallback } from 'react';
import { View, ScrollView, Alert } from 'react-native'; import { View, ScrollView, Alert } from 'react-native';
import { AppContainer, MyText, tw, useMarkDataFetchers, MyTouchableOpacity, MyTextInput } from 'common-ui'; import { AppContainer, MyText, tw, useMarkDataFetchers, MyTouchableOpacity, MyTextInput } from 'common-ui';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { useAppStore } from '@/src/store/appStore';
import { trpc } from '@/src/trpc-client'; import { trpc } from '@/src/trpc-client';
import MaterialIcons from '@expo/vector-icons/MaterialIcons'; import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
@ -112,6 +115,19 @@ function CouponSection({
} }
export default function Coupons() { export default function Coupons() {
const router = useRouter();
const { from } = useLocalSearchParams<{ from?: string }>();
const setHideTabsNavKey = useAppStore((state) => state.setHideTabsNavKey);
// Hide bottom tab bar when opened from the cart page
useFocusEffect(
useCallback(() => {
if (from !== 'cart') return;
setHideTabsNavKey('coupons-from-cart', true);
return () => setHideTabsNavKey('coupons-from-cart', false);
}, [from, setHideTabsNavKey])
);
const { data, isLoading, error, refetch } = trpc.user.coupon.getMyCoupons.useQuery(); const { data, isLoading, error, refetch } = trpc.user.coupon.getMyCoupons.useQuery();
const [couponCode, setCouponCode] = useState(''); const [couponCode, setCouponCode] = useState('');
@ -159,6 +175,15 @@ export default function Coupons() {
return ( return (
<AppContainer> <AppContainer>
<View style={tw`flex-1 p-4`}> <View style={tw`flex-1 p-4`}>
{from === 'cart' && (
<MyTouchableOpacity
onPress={() => router.navigate('/(drawer)/(tabs)/home/cart')}
style={tw`p-2 -ml-2 mr-1 mb-2 self-start`}
activeOpacity={0.7}
>
<MaterialIcons name="chevron-left" size={28} color="#374151" />
</MyTouchableOpacity>
)}
<View style={tw`bg-white rounded-lg p-4 mb-6 shadow-sm border border-gray-100`}> <View style={tw`bg-white rounded-lg p-4 mb-6 shadow-sm border border-gray-100`}>
<MyText style={tw`text-lg font-semibold text-gray-800 mb-3`}> <MyText style={tw`text-lg font-semibold text-gray-800 mb-3`}>
Add a Coupon Add a Coupon

View file

@ -26,7 +26,7 @@ export default function ProductDetailLayout() {
headerShown: true, headerShown: true,
}} }}
> >
<Stack.Screen name="[id]" options={{ title: title || 'Product Details' }} /> <Stack.Screen name="[id]/index" options={{ title: title || 'Product Details' }} />
</Stack> </Stack>
</> </>
); );

View file

@ -848,6 +848,16 @@ export default function CartPage({ isFlashDelivery = false }: CartPageProps) {
</MyText> </MyText>
</MyTouchableOpacity> </MyTouchableOpacity>
)} )}
{/* Link to add coupons to account */}
<MyTouchableOpacity
style={tw`mt-2 ml-1`}
onPress={() => router.push("/(drawer)/(tabs)/me/coupons?from=cart")}
>
<MyText style={tw`text-xs text-blue-500 underline`}>
Add Coupons to account
</MyText>
</MyTouchableOpacity>
</View> </View>
)} )}

View file

@ -3,7 +3,7 @@ import { useGetCart, useUpdateCartItem, useRemoveFromCart } from '../hooks/cart-
import { useAllProducts } from '../hooks/prominent-api-hooks' import { useAllProducts } from '../hooks/prominent-api-hooks'
import { Quantifier } from 'web-components' import { Quantifier } from 'web-components'
import { AppLayout } from '../components/AppLayout' import { AppLayout } from '../components/AppLayout'
import { Trash2, ShoppingCart } from 'lucide-react' import { Trash2, ShoppingCart, Ticket, ChevronRight } from 'lucide-react'
export const Route = createFileRoute('/cart')({ component: CartPage }) export const Route = createFileRoute('/cart')({ component: CartPage })
@ -97,6 +97,23 @@ function CartPage() {
})} })}
</div> </div>
{/* Coupons card */}
<div className="rounded-xl border border-gray-200 bg-white p-4">
<div className="flex items-center gap-2">
<div className="flex h-8 w-8 items-center justify-center rounded-full bg-pink-50">
<Ticket className="h-4 w-4 text-pink-500" />
</div>
<p className="text-base font-bold text-gray-900">Offers &amp; Coupons</p>
</div>
<button
onClick={() => navigate({ to: '/me/coupons' })}
className="mt-2 flex items-center gap-0.5 text-sm font-bold text-brand-600 hover:text-brand-700"
>
Add Coupons to account
<ChevronRight className="h-4 w-4" />
</button>
</div>
{/* Summary */} {/* Summary */}
<div className="lg:sticky lg:top-24 lg:self-start"> <div className="lg:sticky lg:top-24 lg:self-start">
<div className="rounded-xl border border-gray-200 bg-white p-6"> <div className="rounded-xl border border-gray-200 bg-white p-6">