hey-pharmacist-ecommerce 1.1.42 → 1.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -8
- package/dist/index.d.mts +2550 -3081
- package/dist/index.d.ts +2550 -3081
- package/dist/index.js +506 -399
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +506 -397
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/AccountOverviewTab.tsx +5 -5
- package/src/components/AccountReviewsTab.tsx +4 -4
- package/src/components/CartItem.tsx +15 -15
- package/src/components/Header.tsx +1 -1
- package/src/components/Notification.tsx +3 -3
- package/src/components/OrderCard.tsx +1 -1
- package/src/components/ProductCard.tsx +11 -11
- package/src/components/QuickViewModal.tsx +16 -16
- package/src/components/RatingDistribution.tsx +2 -2
- package/src/components/ReviewCard.tsx +2 -2
- package/src/components/ReviewForm.tsx +3 -3
- package/src/components/ReviewPromptBanner.tsx +4 -4
- package/src/components/ReviewsList.tsx +9 -11
- package/src/components/StarRating.tsx +3 -3
- package/src/hooks/useProducts.ts +0 -1
- package/src/hooks/useSmartSearch.ts +68 -0
- package/src/lib/Apis/api.ts +1 -1
- package/src/lib/Apis/apis/analytics-api.ts +809 -0
- package/src/lib/Apis/apis/notifications-api.ts +8 -6
- package/src/lib/Apis/apis/products-api.ts +390 -15
- package/src/lib/Apis/apis/stores-api.ts +26 -149
- package/src/lib/Apis/apis/web-hooks-api.ts +8 -17
- package/src/lib/Apis/models/analytics-period-dto.ts +45 -0
- package/src/lib/Apis/models/appointment-overview-dto.ts +71 -0
- package/src/lib/Apis/models/category-sales-dto.ts +51 -0
- package/src/lib/Apis/models/create-store-dto.ts +12 -0
- package/src/lib/Apis/models/customer-overview-dto.ts +96 -0
- package/src/lib/Apis/models/{country-stats-response-dto.ts → customer-segment-dto.ts} +12 -13
- package/src/lib/Apis/models/dashboard-overview-dto.ts +70 -0
- package/src/lib/Apis/models/discount-overview-dto.ts +71 -0
- package/src/lib/Apis/models/group-with-no-users-dto.ts +0 -6
- package/src/lib/Apis/models/group-with-users-dto.ts +0 -6
- package/src/lib/Apis/models/index.ts +29 -38
- package/src/lib/Apis/models/{single-recipient-dto.ts → inline-response200.ts} +11 -10
- package/src/lib/Apis/models/{create-contact-dto.ts → inline-response2001.ts} +11 -11
- package/src/lib/Apis/models/inventory-alert-dto.ts +67 -0
- package/src/lib/Apis/models/notification-dto.ts +107 -0
- package/src/lib/Apis/models/notifications-paginated-response-dto.ts +58 -0
- package/src/lib/Apis/models/order-overview-dto.ts +89 -0
- package/src/lib/Apis/models/{single-link-stats-dto.ts → order-status-count-dto.ts} +10 -10
- package/src/lib/Apis/models/order.ts +0 -6
- package/src/lib/Apis/models/payout-history-item-dto.ts +45 -0
- package/src/lib/Apis/models/{single-country-stats-dto.ts → popular-time-slot-dto.ts} +10 -10
- package/src/lib/Apis/models/populated-order.ts +0 -6
- package/src/lib/Apis/models/preference-update-item.ts +1 -0
- package/src/lib/Apis/models/product-overview-dto.ts +90 -0
- package/src/lib/Apis/models/product.ts +6 -0
- package/src/lib/Apis/models/{create-contact-list-dto.ts → products-aidraft-body.ts} +4 -4
- package/src/lib/Apis/models/{schedule-campaign-draft-dto.ts → products-processimage-body.ts} +5 -5
- package/src/lib/Apis/models/{contact-full-response-dto.ts → rating-distribution-dto.ts} +9 -10
- package/src/lib/Apis/models/recent-review-dto.ts +63 -0
- package/src/lib/Apis/models/review-overview-dto.ts +65 -0
- package/src/lib/Apis/models/store-balance-dto.ts +39 -0
- package/src/lib/Apis/models/store-entity.ts +12 -0
- package/src/lib/Apis/models/{link-stats-response-dto.ts → store-finance-overview-dto.ts} +10 -15
- package/src/lib/Apis/models/store.ts +12 -0
- package/src/lib/Apis/models/{add-contact-to-list-dto.ts → time-series-point-dto.ts} +9 -9
- package/src/lib/Apis/models/{create-email-template-dto.ts → top-customer-dto.ts} +20 -14
- package/src/lib/Apis/models/{marketing-list-contact-dto.ts → top-discount-dto.ts} +12 -12
- package/src/lib/Apis/models/{single-browser-stats-dto.ts → top-product-dto.ts} +18 -12
- package/src/lib/Apis/models/{marketing-campaign-content-dto.ts → unread-count-dto.ts} +6 -6
- package/src/lib/Apis/models/update-store-dto.ts +12 -0
- package/src/lib/Apis/models/update-user-dto.ts +0 -6
- package/src/lib/Apis/models/user-group.ts +0 -6
- package/src/lib/Apis/models/user-with-no-id.ts +0 -6
- package/src/lib/Apis/sharedConfig.ts +1 -1
- package/src/screens/CartScreen.tsx +10 -10
- package/src/screens/CheckoutScreen.tsx +12 -12
- package/src/screens/OrderReviewsScreen.tsx +6 -6
- package/src/screens/ProductDetailScreen.tsx +40 -40
- package/src/screens/SearchResultsScreen.tsx +17 -21
- package/src/screens/ShopScreen.tsx +20 -82
- package/src/lib/Apis/apis/marketing-api.ts +0 -3099
- package/src/lib/Apis/models/api-key-info-dto.ts +0 -49
- package/src/lib/Apis/models/browser-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-content-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-dto.ts +0 -175
- package/src/lib/Apis/models/campaign-draft-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-schedule-dto.ts +0 -49
- package/src/lib/Apis/models/campaign-draft-schedule-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-sending-dto.ts +0 -43
- package/src/lib/Apis/models/campaign-draft-sending-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-aggregated-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-full-dto.ts +0 -93
- package/src/lib/Apis/models/contact-list-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-lists-response-dto.ts +0 -40
- package/src/lib/Apis/models/create-marketing-campaign-dto.ts +0 -81
- package/src/lib/Apis/models/email-template-response-dto.ts +0 -117
- package/src/lib/Apis/models/general-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/send-test-email-dto.ts +0 -28
- package/src/lib/Apis/models/single-contact-aggregated-stats-dto.ts +0 -129
- package/src/lib/Apis/models/single-contact-list-stats-dto.ts +0 -117
- package/src/lib/Apis/models/single-general-stats.ts +0 -153
- package/src/lib/Apis/models/store-api-keys-response-dto.ts +0 -34
- package/src/lib/Apis/models/update-api-keys-dto.ts +0 -39
- package/src/lib/Apis/models/update-campaign-draft-content-dto.ts +0 -27
- package/src/lib/Apis/models/update-marketing-camp-draft-dto.ts +0 -81
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hey-pharmacist-ecommerce",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.44",
|
|
4
4
|
"description": "Production-ready, multi-tenant e‑commerce UI + API adapter for Next.js with auth, carts, checkout, orders, theming, and pharmacist-focused UX.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
"url": "https://github.com/yourusername/hey-pharmacist-customer/issues"
|
|
73
73
|
},
|
|
74
74
|
"homepage": "https://github.com/yourusername/hey-pharmacist-customer#readme"
|
|
75
|
-
}
|
|
75
|
+
}
|
|
@@ -34,7 +34,7 @@ export function AccountOverviewTab() {
|
|
|
34
34
|
icon: Package,
|
|
35
35
|
label: 'Total Orders',
|
|
36
36
|
value: totalOrders,
|
|
37
|
-
color: 'bg-
|
|
37
|
+
color: 'bg-hprimary-100 text-[#5B9BD5]',
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
icon: CheckCircle,
|
|
@@ -95,7 +95,7 @@ export function AccountOverviewTab() {
|
|
|
95
95
|
</div>
|
|
96
96
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
97
97
|
<div className="flex items-start gap-3">
|
|
98
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-
|
|
98
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-hprimary-100">
|
|
99
99
|
<User className="h-5 w-5 text-hsecondary" />
|
|
100
100
|
</div>
|
|
101
101
|
<div>
|
|
@@ -106,7 +106,7 @@ export function AccountOverviewTab() {
|
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
108
108
|
<div className="flex items-start gap-3">
|
|
109
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-
|
|
109
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-hprimary-100">
|
|
110
110
|
<Mail className="h-5 w-5 text-hsecondary" />
|
|
111
111
|
</div>
|
|
112
112
|
<div>
|
|
@@ -115,7 +115,7 @@ export function AccountOverviewTab() {
|
|
|
115
115
|
</div>
|
|
116
116
|
</div>
|
|
117
117
|
<div className="flex items-start gap-3">
|
|
118
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-
|
|
118
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-hprimary-100">
|
|
119
119
|
<Phone className="h-5 w-5 text-hsecondary" />
|
|
120
120
|
</div>
|
|
121
121
|
<div>
|
|
@@ -126,7 +126,7 @@ export function AccountOverviewTab() {
|
|
|
126
126
|
</div>
|
|
127
127
|
</div>
|
|
128
128
|
<div className="flex items-start gap-3">
|
|
129
|
-
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-
|
|
129
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-hprimary-100">
|
|
130
130
|
<MapPin className="h-5 w-5 text-hsecondary" />
|
|
131
131
|
</div>
|
|
132
132
|
<div>
|
|
@@ -31,7 +31,7 @@ export function AccountReviewsTab() {
|
|
|
31
31
|
<p className="text-red-600 mb-4">Failed to load reviews</p>
|
|
32
32
|
<button
|
|
33
33
|
onClick={() => window.location.reload()}
|
|
34
|
-
className="text-
|
|
34
|
+
className="text-haccent-500 hover:underline text-sm"
|
|
35
35
|
>
|
|
36
36
|
Try again
|
|
37
37
|
</button>
|
|
@@ -44,8 +44,8 @@ export function AccountReviewsTab() {
|
|
|
44
44
|
return (
|
|
45
45
|
<div className="p-6">
|
|
46
46
|
<div className="text-center py-12">
|
|
47
|
-
<div className="size-16 rounded-full bg-
|
|
48
|
-
<Star className="size-8 text-
|
|
47
|
+
<div className="size-16 rounded-full bg-haccent-500/10 flex items-center justify-center mx-auto mb-4">
|
|
48
|
+
<Star className="size-8 text-haccent-500" />
|
|
49
49
|
</div>
|
|
50
50
|
<h3 className="text-lg font-semibold text-gray-900 mb-2">
|
|
51
51
|
No reviews yet
|
|
@@ -55,7 +55,7 @@ export function AccountReviewsTab() {
|
|
|
55
55
|
</p>
|
|
56
56
|
<button
|
|
57
57
|
onClick={() => router.push(buildPath('/reviews'))}
|
|
58
|
-
className="inline-flex items-center gap-2 px-6 py-3 bg-
|
|
58
|
+
className="inline-flex items-center gap-2 px-6 py-3 bg-haccent-500 text-white rounded-lg font-medium hover:bg-[#d66f40] transition-colors"
|
|
59
59
|
>
|
|
60
60
|
<Star className="size-4" />
|
|
61
61
|
Write Your First Review
|
|
@@ -50,14 +50,12 @@ export function CartItem({ item }: CartItemProps) {
|
|
|
50
50
|
initial={{ opacity: 0, y: 20 }}
|
|
51
51
|
animate={{ opacity: 1, y: 0 }}
|
|
52
52
|
exit={{ opacity: 0, x: -100 }}
|
|
53
|
-
className="bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-hsecondary/30 transition-all duration-300"
|
|
53
|
+
className="bg-white border-2 border-gray-100 rounded-[24px] p-4 md:p-6 hover:border-hsecondary/30 transition-all duration-300"
|
|
54
54
|
>
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
<div className="flex gap-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<div className="w-28 h-28 rounded-[16px] overflow-hidden bg-gray-50 shrink-0">
|
|
57
|
+
<div className="flex gap-3 md:gap-4">
|
|
58
|
+
<div className="w-20 h-20 md:w-28 md:h-28 rounded-[16px] overflow-hidden bg-gray-50 shrink-0">
|
|
61
59
|
<Image
|
|
62
60
|
src={item.productVariantData.media[0]?.file || PLACEHOLDER_IMAGE_SRC}
|
|
63
61
|
alt={item.productVariantData.name}
|
|
@@ -71,11 +69,11 @@ export function CartItem({ item }: CartItemProps) {
|
|
|
71
69
|
<div className="flex-1 min-w-0">
|
|
72
70
|
<div className="flex items-start justify-between gap-4 mb-3">
|
|
73
71
|
<div className="flex-1 min-w-0">
|
|
74
|
-
<h3 className="font-
|
|
72
|
+
<h3 className="font-semibold text-[#2B4B7C] mb-2">
|
|
75
73
|
{item.productVariantData.name}
|
|
76
74
|
</h3>
|
|
77
75
|
<div className="flex flex-wrap items-center gap-3">
|
|
78
|
-
<span className="
|
|
76
|
+
<span className="text-[12px] text-[#676c80]">
|
|
79
77
|
Variant: <span className="font-medium text-[#2B4B7C]">{item.productVariantData.name}</span>
|
|
80
78
|
</span>
|
|
81
79
|
</div>
|
|
@@ -98,34 +96,36 @@ export function CartItem({ item }: CartItemProps) {
|
|
|
98
96
|
</div>
|
|
99
97
|
|
|
100
98
|
{/* Quantity and Price */}
|
|
101
|
-
<div className="flex items-center justify-between gap-4">
|
|
99
|
+
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 mt-auto">
|
|
102
100
|
{/* Quantity Controls */}
|
|
103
|
-
<div className="flex items-center gap-3 bg-gray-50 rounded-full px-4 py-2">
|
|
101
|
+
<div className="flex items-center gap-3 bg-gray-50 rounded-full px-3 py-1.5 md:px-4 md:py-2 w-fit">
|
|
104
102
|
<button
|
|
105
103
|
onClick={() => handleUpdateQuantity(item.quantity - 1)}
|
|
106
104
|
disabled={isUpdating || item.quantity <= 1}
|
|
107
105
|
className="p-1 hover:bg-white rounded-full transition-colors"
|
|
106
|
+
aria-label="Decrease quantity"
|
|
108
107
|
>
|
|
109
|
-
<Minus className="size-4 text-[#2B4B7C]" />
|
|
108
|
+
<Minus className="size-3 md:size-4 text-[#2B4B7C]" />
|
|
110
109
|
</button>
|
|
111
|
-
<span className="font-[
|
|
110
|
+
<span className="font-semibold text-[13px] md:text-[14px] text-[#2B4B7C] min-w-[20px] text-center">
|
|
112
111
|
{item.quantity}
|
|
113
112
|
</span>
|
|
114
113
|
<button
|
|
115
114
|
onClick={() => handleUpdateQuantity(item.quantity + 1)}
|
|
116
115
|
disabled={isUpdating || item.quantity >= (item.productVariantData.inventoryCount || 999)}
|
|
117
116
|
className="p-1 hover:bg-white rounded-full transition-colors"
|
|
117
|
+
aria-label="Increase quantity"
|
|
118
118
|
>
|
|
119
|
-
<Plus className="size-4 text-[#2B4B7C]" />
|
|
119
|
+
<Plus className="size-3 md:size-4 text-[#2B4B7C]" />
|
|
120
120
|
</button>
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
123
|
{/* Price */}
|
|
124
|
-
<div className="text-right">
|
|
125
|
-
<p className="font-[
|
|
124
|
+
<div className="text-left sm:text-right">
|
|
125
|
+
<p className="font-bold text-[16px] md:text-[18px] text-hsecondary">
|
|
126
126
|
{formatPrice(itemTotal)}
|
|
127
127
|
</p>
|
|
128
|
-
<p className="
|
|
128
|
+
<p className="text-[10px] md:text-[11px] text-[#676c80]">
|
|
129
129
|
{formatPrice(unitPrice)} each
|
|
130
130
|
</p>
|
|
131
131
|
</div>
|
|
@@ -176,7 +176,7 @@ export function Header() {
|
|
|
176
176
|
<div className="absolute right-0 top-full mt-2 w-56 rounded-lg border border-slate-200 bg-white shadow-lg z-20">
|
|
177
177
|
<div className="p-2">
|
|
178
178
|
<div className="px-3 py-2 border-b border-slate-200 mb-1">
|
|
179
|
-
<p className="text-sm font-medium text-
|
|
179
|
+
<p className="text-sm font-medium text-hprimary-900 truncate">
|
|
180
180
|
{user?.firstname} {user?.lastname}
|
|
181
181
|
</p>
|
|
182
182
|
<p className="text-xs text-slate-500 truncate">{user?.email}</p>
|
|
@@ -78,7 +78,7 @@ export function Notification({ notification, onDismiss }: NotificationProps) {
|
|
|
78
78
|
animate={{ opacity: 1, y: 0, scale: 1 }}
|
|
79
79
|
exit={{ opacity: 0, x: 100, scale: 0.95 }}
|
|
80
80
|
transition={{ type: 'spring', stiffness: 500, damping: 30 }}
|
|
81
|
-
className={`relative bg-
|
|
81
|
+
className={`relative bg-hprimary-50 rounded-2xl border-2 ${config.borderColor} shadow-xl overflow-hidden min-w-[320px] max-w-[420px]`}
|
|
82
82
|
>
|
|
83
83
|
{/* Gradient accent bar */}
|
|
84
84
|
<div className={`h-1 bg-linear-to-r ${config.gradient}`} />
|
|
@@ -96,11 +96,11 @@ export function Notification({ notification, onDismiss }: NotificationProps) {
|
|
|
96
96
|
|
|
97
97
|
{/* Content */}
|
|
98
98
|
<div className="flex-1 min-w-0">
|
|
99
|
-
<p className="font-
|
|
99
|
+
<p className="font-semibold text-[14px] text-[#2B4B7C] mb-1">
|
|
100
100
|
{notification.message}
|
|
101
101
|
</p>
|
|
102
102
|
{notification.description && (
|
|
103
|
-
<p className="
|
|
103
|
+
<p className="text-[12px] text-[#676c80] leading-relaxed">
|
|
104
104
|
{notification.description}
|
|
105
105
|
</p>
|
|
106
106
|
)}
|
|
@@ -179,7 +179,7 @@ export function OrderCard({ order, onDelete }: OrderCardProps) {
|
|
|
179
179
|
{isCompletedOrder && (
|
|
180
180
|
<button
|
|
181
181
|
onClick={handleReviewClick}
|
|
182
|
-
className="inline-flex items-center gap-2 rounded-lg border border-
|
|
182
|
+
className="inline-flex items-center gap-2 rounded-lg border border-haccent-500 bg-white hover:bg-haccent-500/5 text-haccent-500 px-4 py-2 text-sm transition-colors"
|
|
183
183
|
onPointerDown={(e) => e.stopPropagation()}
|
|
184
184
|
>
|
|
185
185
|
<Star className="w-4 h-4" />
|
|
@@ -218,7 +218,7 @@ export function ProductCard({
|
|
|
218
218
|
{displayInventoryCount === 0 && (
|
|
219
219
|
<div className="absolute inset-0 bg-black/50 backdrop-blur-xs flex items-center justify-center">
|
|
220
220
|
<div className="bg-white rounded-full px-4 py-2">
|
|
221
|
-
<span className="font-
|
|
221
|
+
<span className="font-bold text-[11px] text-[#2B4B7C] uppercase">
|
|
222
222
|
Out of Stock
|
|
223
223
|
</span>
|
|
224
224
|
</div>
|
|
@@ -232,24 +232,24 @@ export function ProductCard({
|
|
|
232
232
|
{/* ALL Status Badges */}
|
|
233
233
|
<div className="flex items-center gap-1 mb-2 flex-wrap">
|
|
234
234
|
{displayIsDiscounted && (
|
|
235
|
-
<span className="bg-
|
|
236
|
-
<span className="font-
|
|
235
|
+
<span className="bg-haccent-500 text-white rounded-full px-2 py-0.5 flex items-center gap-1">
|
|
236
|
+
<span className="font-bold text-[8px] uppercase">-{displayDiscountAmount}%</span>
|
|
237
237
|
</span>
|
|
238
238
|
)}
|
|
239
239
|
|
|
240
240
|
</div>
|
|
241
241
|
<div className="mb-1">
|
|
242
|
-
<p className="
|
|
242
|
+
<p className="text-xs text-hsecondary uppercase tracking-wide font-medium">
|
|
243
243
|
{product.brand}
|
|
244
244
|
</p>
|
|
245
245
|
</div>
|
|
246
246
|
|
|
247
247
|
<div className="h-[40px] mb-3">
|
|
248
|
-
<h3 className="text-sm font-
|
|
248
|
+
<h3 className="text-sm font-semibold text-[#2B4B7C] line-clamp-2">
|
|
249
249
|
{product.name}
|
|
250
250
|
</h3>
|
|
251
251
|
{selectedVariant && (
|
|
252
|
-
<p className="text-xs
|
|
252
|
+
<p className="text-xs text-[#676c80]">
|
|
253
253
|
{selectedVariant.name}
|
|
254
254
|
</p>
|
|
255
255
|
)}
|
|
@@ -261,24 +261,24 @@ export function ProductCard({
|
|
|
261
261
|
<Star
|
|
262
262
|
key={i}
|
|
263
263
|
className={`size-4 ${i < Math.floor(product.summary?.averageRating || 0)
|
|
264
|
-
? 'text-
|
|
264
|
+
? 'text-hsecondary fill-hsecondary-500'
|
|
265
265
|
: 'text-gray-300'
|
|
266
266
|
}`}
|
|
267
267
|
/>
|
|
268
268
|
))}
|
|
269
269
|
</div>
|
|
270
|
-
<span className="
|
|
270
|
+
<span className="text-[10px] text-[#676c80] ">
|
|
271
271
|
({product.summary?.reviewCount || 0})
|
|
272
272
|
</span>
|
|
273
273
|
</div>
|
|
274
274
|
|
|
275
275
|
{/* Price */}
|
|
276
276
|
<div className="flex items-center gap-1.5 mb-3">
|
|
277
|
-
<span className="font-
|
|
277
|
+
<span className="font-bold text-md text-hprimary-600">
|
|
278
278
|
${displayFinalPrice.toFixed(2)}
|
|
279
279
|
</span>
|
|
280
280
|
{displayIsDiscounted && (
|
|
281
|
-
<span className="
|
|
281
|
+
<span className="text-sm text-[#676c80] line-through">
|
|
282
282
|
${displayPriceBeforeDiscount.toFixed(2)}
|
|
283
283
|
</span>
|
|
284
284
|
)}
|
|
@@ -358,7 +358,7 @@ export function ProductCard({
|
|
|
358
358
|
}
|
|
359
359
|
}}
|
|
360
360
|
disabled={isAddingToCart || (variantImages.length > 0 && !selectedVariantId) || displayInventoryCount === 0}
|
|
361
|
-
className="w-full font-
|
|
361
|
+
className="w-full font-medium text-[11px] px-3 py-2 rounded-full bg-hsecondary text-white hover:bg-hsecondary/80 hover:shadow-lg transition-all duration-300 flex items-center justify-center gap-1.5 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"
|
|
362
362
|
>
|
|
363
363
|
<ShoppingCart className="h-4 w-4" />
|
|
364
364
|
{displayInventoryCount === 0 ? 'Out of Stock' : 'Add to Cart'}
|
|
@@ -74,10 +74,10 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
74
74
|
{/* Header */}
|
|
75
75
|
<div className="flex items-start justify-between mb-6">
|
|
76
76
|
<div>
|
|
77
|
-
<p className="
|
|
77
|
+
<p className="text-[11px] text-hprimary uppercase tracking-wide font-medium mb-2">
|
|
78
78
|
{product.brand}
|
|
79
79
|
</p>
|
|
80
|
-
<h2 className="font-
|
|
80
|
+
<h2 className="font-semibold text-hsecondary tracking-[-1px]">
|
|
81
81
|
{displayName}
|
|
82
82
|
</h2>
|
|
83
83
|
|
|
@@ -94,7 +94,7 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
94
94
|
/>
|
|
95
95
|
))}
|
|
96
96
|
</div>
|
|
97
|
-
<span className="
|
|
97
|
+
<span className="text-[13px] text-hmuted">
|
|
98
98
|
{product.summary?.averageRating || 0} ({product.summary?.reviewCount || 0} reviews)
|
|
99
99
|
</span>
|
|
100
100
|
</div>
|
|
@@ -120,14 +120,14 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
120
120
|
<div className="absolute top-4 left-4 flex flex-col gap-2">
|
|
121
121
|
{isDiscounted && (
|
|
122
122
|
<div className="bg-haccent text-white rounded-full px-3 py-1.5">
|
|
123
|
-
<span className="font-
|
|
123
|
+
<span className="font-bold text-[11px] uppercase">
|
|
124
124
|
-{discountAmount}%
|
|
125
125
|
</span>
|
|
126
126
|
</div>
|
|
127
127
|
)}
|
|
128
128
|
{/* {product.bestseller && (
|
|
129
129
|
<div className="bg-hsecondary text-white rounded-full px-3 py-1.5">
|
|
130
|
-
<span className="font-
|
|
130
|
+
<span className="font-semibold text-[10px] uppercase">
|
|
131
131
|
Bestseller
|
|
132
132
|
</span>
|
|
133
133
|
</div>
|
|
@@ -159,11 +159,11 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
159
159
|
<div className="flex flex-col">
|
|
160
160
|
{/* Price */}
|
|
161
161
|
<div className="flex items-center gap-3 mb-4">
|
|
162
|
-
<span className="font-
|
|
162
|
+
<span className="font-bold text-[32px] text-haccent">
|
|
163
163
|
${displayPrice.toFixed(2)}
|
|
164
164
|
</span>
|
|
165
165
|
{isDiscounted && (
|
|
166
|
-
<span className="
|
|
166
|
+
<span className="text-[20px] text-hmuted line-through">
|
|
167
167
|
${displayOriginalPrice.toFixed(2)}
|
|
168
168
|
</span>
|
|
169
169
|
)}
|
|
@@ -172,16 +172,16 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
172
172
|
{/* Stock Status */}
|
|
173
173
|
<div className="mb-6">
|
|
174
174
|
{selectedVariant.inventoryCount === 0 ? (
|
|
175
|
-
<span className="
|
|
175
|
+
<span className="text-[12px] text-red-500 font-medium">
|
|
176
176
|
Out of Stock
|
|
177
177
|
</span>
|
|
178
178
|
) : selectedVariant.inventoryCount <= 10 ? (
|
|
179
|
-
<span className="
|
|
179
|
+
<span className="text-[12px] text-hprimary font-medium flex items-center gap-1">
|
|
180
180
|
<Package className="size-3" />
|
|
181
181
|
Only {selectedVariant.inventoryCount} left in stock
|
|
182
182
|
</span>
|
|
183
183
|
) : (
|
|
184
|
-
<span className="
|
|
184
|
+
<span className="text-[12px] text-green-600 font-medium flex items-center gap-1">
|
|
185
185
|
<Package className="size-3" />
|
|
186
186
|
In Stock
|
|
187
187
|
</span>
|
|
@@ -190,13 +190,13 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
190
190
|
|
|
191
191
|
{/* Description */}
|
|
192
192
|
<div
|
|
193
|
-
className="
|
|
193
|
+
className="text-[14px] text-hmuted leading-[1.7] mb-6 max-w-full overflow-hidden break-words"
|
|
194
194
|
dangerouslySetInnerHTML={{ __html: product.description }}
|
|
195
195
|
/>
|
|
196
196
|
|
|
197
197
|
{/* Color Selection */}
|
|
198
198
|
<div className="mb-6">
|
|
199
|
-
<h3 className="font-
|
|
199
|
+
<h3 className="font-semibold text-[13px] text-hsecondary mb-3">
|
|
200
200
|
Selected Variant: <span className="font-normal text-hmuted">{product.variants[selectedVariantIndex].name}</span>
|
|
201
201
|
</h3>
|
|
202
202
|
<div className="flex flex-wrap gap-3">
|
|
@@ -232,7 +232,7 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
232
232
|
{product.tags.slice(0, 3).map((feature: any, index: any) => (
|
|
233
233
|
<li key={index} className="flex items-start gap-2">
|
|
234
234
|
<Check className="size-4 text-hprimary shrink-0 mt-0.5" />
|
|
235
|
-
<span className="
|
|
235
|
+
<span className="text-[12px] text-hmuted">
|
|
236
236
|
{feature}
|
|
237
237
|
</span>
|
|
238
238
|
</li>
|
|
@@ -242,7 +242,7 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
242
242
|
|
|
243
243
|
{/* Quantity Selector */}
|
|
244
244
|
<div className="mb-6">
|
|
245
|
-
<h3 className="font-
|
|
245
|
+
<h3 className="font-semibold text-[13px] text-hsecondary mb-3">
|
|
246
246
|
Quantity
|
|
247
247
|
</h3>
|
|
248
248
|
<div className="flex items-center gap-4">
|
|
@@ -269,7 +269,7 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
269
269
|
<button
|
|
270
270
|
onClick={handleAddToCart}
|
|
271
271
|
disabled={addedToCart || selectedVariant.inventoryCount === 0}
|
|
272
|
-
className={`w-full font-
|
|
272
|
+
className={`w-full font-medium text-[14px] px-6 py-4 rounded-full transition-all duration-300 flex items-center justify-center gap-3 ${addedToCart
|
|
273
273
|
? 'bg-green-500 text-white'
|
|
274
274
|
: 'bg-haccent text-white hover:bg-[#d66f45] hover:shadow-lg disabled:opacity-50 disabled:cursor-not-allowed'
|
|
275
275
|
}`}
|
|
@@ -301,7 +301,7 @@ export function QuickViewModal({ product, onClose, onNavigateToProduct }: QuickV
|
|
|
301
301
|
onClose();
|
|
302
302
|
// onNavigateToProduct?.(product._id || product.id);
|
|
303
303
|
}}
|
|
304
|
-
className="w-full font-
|
|
304
|
+
className="w-full font-medium text-[13px] px-6 py-3 rounded-full bg-white text-hsecondary border-2 border-hprimary hover:bg-gray-50 transition-all flex items-center justify-center gap-2"
|
|
305
305
|
>
|
|
306
306
|
View Full Details
|
|
307
307
|
<ExternalLink className="size-4" />
|
|
@@ -55,12 +55,12 @@ export function RatingDistribution({ reviews, averageRating }: RatingDistributio
|
|
|
55
55
|
<div key={rating} className="flex items-center gap-3">
|
|
56
56
|
<div className="flex items-center gap-1 w-16">
|
|
57
57
|
<span className="text-sm font-medium text-gray-700">{rating}</span>
|
|
58
|
-
<Star className="size-3 fill-
|
|
58
|
+
<Star className="size-3 fill-haccent-500 text-haccent-500" />
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
61
|
<div className="flex-1 h-2 bg-gray-200 rounded-full overflow-hidden">
|
|
62
62
|
<div
|
|
63
|
-
className="h-full bg-
|
|
63
|
+
className="h-full bg-haccent-500 transition-all duration-300"
|
|
64
64
|
style={{ width: `${percentage}%` }}
|
|
65
65
|
/>
|
|
66
66
|
</div>
|
|
@@ -16,7 +16,7 @@ export function ReviewCard({ review, showProductInfo = false }: ReviewCardProps)
|
|
|
16
16
|
const replyDate = review.replyDate ? new Date(review.replyDate) : null;
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<div className="border border-gray-200 rounded-lg p-4 bg-
|
|
19
|
+
<div className="border border-gray-200 rounded-lg p-4 bg-hprimary-50">
|
|
20
20
|
<div className="flex items-start justify-between mb-3">
|
|
21
21
|
<div className="flex items-center gap-3">
|
|
22
22
|
<div className="w-10 h-10 bg-hsecondary/10 rounded-full flex items-center justify-center">
|
|
@@ -33,7 +33,7 @@ export function ReviewCard({ review, showProductInfo = false }: ReviewCardProps)
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
{review.reviewType && (
|
|
36
|
-
<span className="inline-block px-2 py-1 text-xs bg-
|
|
36
|
+
<span className="inline-block px-2 py-1 text-xs bg-hprimary-100 text-gray-600 rounded mb-2">
|
|
37
37
|
{review.reviewType}
|
|
38
38
|
</span>
|
|
39
39
|
)}
|
|
@@ -148,7 +148,7 @@ export function ReviewForm({
|
|
|
148
148
|
<select
|
|
149
149
|
id="reviewType"
|
|
150
150
|
{...register('reviewType')}
|
|
151
|
-
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-
|
|
151
|
+
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-haccent-500 focus:border-transparent"
|
|
152
152
|
>
|
|
153
153
|
<option value="Product Review">Product Review</option>
|
|
154
154
|
<option value="Quality Review">Quality Review</option>
|
|
@@ -169,7 +169,7 @@ export function ReviewForm({
|
|
|
169
169
|
{...register('review')}
|
|
170
170
|
rows={5}
|
|
171
171
|
placeholder="Share your experience with this product..."
|
|
172
|
-
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-
|
|
172
|
+
className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-haccent-500 focus:border-transparent resize-none"
|
|
173
173
|
/>
|
|
174
174
|
{errors.review && (
|
|
175
175
|
<p className="text-red-500 text-xs mt-1">{errors.review.message}</p>
|
|
@@ -180,7 +180,7 @@ export function ReviewForm({
|
|
|
180
180
|
<button
|
|
181
181
|
type="submit"
|
|
182
182
|
disabled={isLoading}
|
|
183
|
-
className="flex-1 bg-
|
|
183
|
+
className="flex-1 bg-haccent-500 text-white py-3 px-6 rounded-lg font-medium hover:bg-[#d66f40] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"
|
|
184
184
|
>
|
|
185
185
|
{isLoading ? (
|
|
186
186
|
<>
|
|
@@ -55,11 +55,11 @@ export function ReviewPromptBanner({
|
|
|
55
55
|
if (!isVisible) return null;
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
|
-
<div className="bg-gradient-to-r from-
|
|
58
|
+
<div className="bg-gradient-to-r from-haccent-500/10 to-haccent-500/5 border border-haccent-500/20 rounded-lg p-4 mb-4">
|
|
59
59
|
<div className="flex items-start gap-4">
|
|
60
60
|
<div className="flex-shrink-0">
|
|
61
|
-
<div className="size-10 rounded-full bg-
|
|
62
|
-
<Star className="size-5 text-
|
|
61
|
+
<div className="size-10 rounded-full bg-haccent-500/20 flex items-center justify-center">
|
|
62
|
+
<Star className="size-5 text-haccent-500" />
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
@@ -86,7 +86,7 @@ export function ReviewPromptBanner({
|
|
|
86
86
|
|
|
87
87
|
<button
|
|
88
88
|
onClick={handleReviewClick}
|
|
89
|
-
className="mt-3 inline-flex items-center gap-2 px-4 py-2 bg-
|
|
89
|
+
className="mt-3 inline-flex items-center gap-2 px-4 py-2 bg-haccent-500 text-white text-sm font-medium rounded-lg hover:bg-[#d66f40] transition-colors"
|
|
90
90
|
>
|
|
91
91
|
<Star className="size-4" />
|
|
92
92
|
Write a Review
|
|
@@ -79,11 +79,10 @@ export function ReviewsList({ reviews, isLoading }: ReviewsListProps) {
|
|
|
79
79
|
<div className="flex items-center gap-2">
|
|
80
80
|
<button
|
|
81
81
|
onClick={() => setFilterRating('all')}
|
|
82
|
-
className={`px-3 py-1 text-sm rounded-full transition-colors ${
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}`}
|
|
82
|
+
className={`px-3 py-1 text-sm rounded-full transition-colors ${filterRating === 'all'
|
|
83
|
+
? 'bg-haccent-500 text-white'
|
|
84
|
+
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
|
85
|
+
}`}
|
|
87
86
|
>
|
|
88
87
|
All
|
|
89
88
|
</button>
|
|
@@ -91,11 +90,10 @@ export function ReviewsList({ reviews, isLoading }: ReviewsListProps) {
|
|
|
91
90
|
<button
|
|
92
91
|
key={rating}
|
|
93
92
|
onClick={() => setFilterRating(rating as FilterOption)}
|
|
94
|
-
className={`flex items-center gap-1 px-3 py-1 text-sm rounded-full transition-colors ${
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}`}
|
|
93
|
+
className={`flex items-center gap-1 px-3 py-1 text-sm rounded-full transition-colors ${filterRating === rating
|
|
94
|
+
? 'bg-haccent-500 text-white'
|
|
95
|
+
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
|
96
|
+
}`}
|
|
99
97
|
>
|
|
100
98
|
{rating}
|
|
101
99
|
<Star className="size-3 fill-current" />
|
|
@@ -109,7 +107,7 @@ export function ReviewsList({ reviews, isLoading }: ReviewsListProps) {
|
|
|
109
107
|
<select
|
|
110
108
|
value={sortBy}
|
|
111
109
|
onChange={(e) => setSortBy(e.target.value as SortOption)}
|
|
112
|
-
className="px-3 py-1 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-
|
|
110
|
+
className="px-3 py-1 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-haccent-500 focus:border-transparent"
|
|
113
111
|
>
|
|
114
112
|
<option value="recent">Most Recent</option>
|
|
115
113
|
<option value="oldest">Oldest First</option>
|
|
@@ -72,15 +72,15 @@ export function StarRating({
|
|
|
72
72
|
<div className="relative">
|
|
73
73
|
<Star className={`${sizeClasses[size]} text-gray-300`} />
|
|
74
74
|
<div className="absolute inset-0 overflow-hidden" style={{ width: '50%' }}>
|
|
75
|
-
<Star className={`${sizeClasses[size]} fill-
|
|
75
|
+
<Star className={`${sizeClasses[size]} fill-haccent-500 text-haccent-500`} />
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
) : (
|
|
79
79
|
<Star
|
|
80
80
|
className={`
|
|
81
81
|
${sizeClasses[size]}
|
|
82
|
-
${isFilled ? 'fill-
|
|
83
|
-
${interactive && hoverRating > 0 && index < hoverRating ? 'fill-
|
|
82
|
+
${isFilled ? 'fill-haccent-500 text-haccent-500' : 'text-gray-300'}
|
|
83
|
+
${interactive && hoverRating > 0 && index < hoverRating ? 'fill-haccent-500 text-haccent-500' : ''}
|
|
84
84
|
`}
|
|
85
85
|
/>
|
|
86
86
|
)}
|
package/src/hooks/useProducts.ts
CHANGED
|
@@ -24,7 +24,6 @@ export function useProducts(filters?: ProductFilters, page: number = 1, limit: n
|
|
|
24
24
|
],
|
|
25
25
|
queryFn: async () => {
|
|
26
26
|
const response = await new ProductsApi(AXIOS_CONFIG).getAllProducts(
|
|
27
|
-
filters?.search ?? "", // searchTerm
|
|
28
27
|
filters?.maxPrice, // maxPrice
|
|
29
28
|
filters?.minPrice, // minPrice
|
|
30
29
|
undefined, // brandFilter
|