hey-pharmacist-ecommerce 1.1.38 → 1.1.39
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 +0 -3
- package/dist/index.d.mts +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/index.js +67 -67
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -67
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/AccountOrdersTab.tsx +6 -1
- package/src/components/AccountOverviewTab.tsx +6 -5
- package/src/components/AccountReviewsTab.tsx +1 -1
- package/src/components/CartItem.tsx +2 -2
- package/src/components/ProductCard.tsx +4 -21
- package/src/components/ReviewCard.tsx +4 -4
- package/src/lib/types/index.ts +4 -6
- package/src/providers/ThemeProvider.tsx +9 -15
- package/src/screens/CartScreen.tsx +3 -3
- package/src/screens/CheckoutScreen.tsx +9 -9
- package/src/screens/LoginScreen.tsx +1 -9
- package/src/screens/OrderDetailScreen.tsx +23 -2
- package/src/screens/ProductDetailScreen.tsx +1 -1
- package/src/screens/WishlistScreen.tsx +1 -1
- package/src/styles/globals.css +1 -6
package/dist/index.mjs
CHANGED
|
@@ -241,18 +241,12 @@ function ThemeProvider({ config, children }) {
|
|
|
241
241
|
Object.entries(accentShades).forEach(([shade, rgb]) => {
|
|
242
242
|
root.style.setProperty(`--color-accent-${shade}`, rgb);
|
|
243
243
|
});
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
root.style.setProperty(`--header-to`, `${tr} ${tg} ${tb}`);
|
|
251
|
-
} else {
|
|
252
|
-
root.style.setProperty(`--header-from`, primaryShades[700]);
|
|
253
|
-
root.style.setProperty(`--header-via`, primaryShades[600]);
|
|
254
|
-
root.style.setProperty(`--header-to`, secondaryShades[600]);
|
|
255
|
-
}
|
|
244
|
+
root.style.setProperty("--color-primary", config.colors.primary);
|
|
245
|
+
root.style.setProperty("--color-primary-dark", config.colors.primaryDark);
|
|
246
|
+
root.style.setProperty("--color-secondary", config.colors.secondary);
|
|
247
|
+
root.style.setProperty("--color-accent", config.colors.accent);
|
|
248
|
+
root.style.setProperty("--color-accent-dark", config.colors.accentDark);
|
|
249
|
+
root.style.setProperty("--color-text-muted", config.colors.textMuted);
|
|
256
250
|
}, [config]);
|
|
257
251
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { config }, children });
|
|
258
252
|
}
|
|
@@ -13032,7 +13026,7 @@ function ProductCard({
|
|
|
13032
13026
|
/* @__PURE__ */ jsxs(
|
|
13033
13027
|
motion.div,
|
|
13034
13028
|
{
|
|
13035
|
-
className: "bg-white rounded-[16px] overflow-hidden border-2 border-gray-100 hover:border-
|
|
13029
|
+
className: "bg-white rounded-[16px] overflow-hidden border-2 border-gray-100 hover:border-secondary hover:shadow-lg transition-all duration-300 group h-full flex flex-col",
|
|
13036
13030
|
whileHover: { y: -4 },
|
|
13037
13031
|
onMouseEnter: () => setIsHovered(true),
|
|
13038
13032
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -13084,7 +13078,7 @@ function ProductCard({
|
|
|
13084
13078
|
displayDiscountAmount,
|
|
13085
13079
|
"%"
|
|
13086
13080
|
] }) }) }),
|
|
13087
|
-
/* @__PURE__ */ jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] text-xs text-
|
|
13081
|
+
/* @__PURE__ */ jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] text-xs text-secondary uppercase tracking-wide font-medium", children: product.brand }) }),
|
|
13088
13082
|
/* @__PURE__ */ jsxs("div", { className: "h-[40px] mb-3", children: [
|
|
13089
13083
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] line-clamp-2", children: product.name }),
|
|
13090
13084
|
selectedVariant && /* @__PURE__ */ jsx("p", { className: "text-xs font-['Poppins',sans-serif] text-[#676c80]", children: selectedVariant.name })
|
|
@@ -13183,7 +13177,7 @@ function ProductCard({
|
|
|
13183
13177
|
}
|
|
13184
13178
|
},
|
|
13185
13179
|
disabled: isAddingToCart || variantImages.length > 0 && !selectedVariantId || displayInventoryCount === 0,
|
|
13186
|
-
className: "w-full font-['Poppins',sans-serif] font-medium text-[11px] px-3 py-2 rounded-full bg-
|
|
13180
|
+
className: "w-full font-['Poppins',sans-serif] font-medium text-[11px] px-3 py-2 rounded-full bg-secondary text-white hover:bg-secondary/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",
|
|
13187
13181
|
children: [
|
|
13188
13182
|
/* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }),
|
|
13189
13183
|
displayInventoryCount === 0 ? "Out of Stock" : "Add to Cart"
|
|
@@ -14728,7 +14722,7 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14728
14722
|
return /* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-lg p-4 bg-white", children: [
|
|
14729
14723
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-3", children: [
|
|
14730
14724
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
14731
|
-
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 bg-
|
|
14725
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 bg-secondary/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx(User, { className: "size-5 text-secondary" }) }),
|
|
14732
14726
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
14733
14727
|
/* @__PURE__ */ jsx("p", { className: "font-medium text-gray-900", children: "Customer Review" }),
|
|
14734
14728
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: formatDistanceToNow(reviewDate, { addSuffix: true }) })
|
|
@@ -14738,9 +14732,9 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14738
14732
|
] }),
|
|
14739
14733
|
review.reviewType && /* @__PURE__ */ jsx("span", { className: "inline-block px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded mb-2", children: review.reviewType }),
|
|
14740
14734
|
/* @__PURE__ */ jsx("p", { className: "text-gray-700 text-sm leading-relaxed mb-3", children: review.review }),
|
|
14741
|
-
review.reply && /* @__PURE__ */ jsxs("div", { className: "mt-4 pl-4 border-l-2 border-
|
|
14735
|
+
review.reply && /* @__PURE__ */ jsxs("div", { className: "mt-4 pl-4 border-l-2 border-secondary bg-gray-50 p-3 rounded", children: [
|
|
14742
14736
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
14743
|
-
/* @__PURE__ */ jsx(MessageCircle, { className: "size-4 text-
|
|
14737
|
+
/* @__PURE__ */ jsx(MessageCircle, { className: "size-4 text-secondary" }),
|
|
14744
14738
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-gray-900", children: "Store Response" }),
|
|
14745
14739
|
replyDate && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: formatDistanceToNow(replyDate, { addSuffix: true }) })
|
|
14746
14740
|
] }),
|
|
@@ -15334,7 +15328,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
15334
15328
|
)
|
|
15335
15329
|
] })
|
|
15336
15330
|
] }),
|
|
15337
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 p-6 bg-linear-to-br from-
|
|
15331
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 p-6 bg-linear-to-br from-secondary/5 to-secondary/5 rounded-[24px]", children: [
|
|
15338
15332
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
15339
15333
|
/* @__PURE__ */ jsx("div", { className: "size-10 rounded-full bg-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(Truck, { className: "size-5 text-primary" }) }),
|
|
15340
15334
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -15444,7 +15438,7 @@ function CartItem({ item }) {
|
|
|
15444
15438
|
initial: { opacity: 0, y: 20 },
|
|
15445
15439
|
animate: { opacity: 1, y: 0 },
|
|
15446
15440
|
exit: { opacity: 0, x: -100 },
|
|
15447
|
-
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-
|
|
15441
|
+
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-secondary/30 transition-all duration-300",
|
|
15448
15442
|
children: /* @__PURE__ */ jsxs("div", { className: "flex gap-4 pr-8", children: [
|
|
15449
15443
|
/* @__PURE__ */ jsx("div", { className: "w-28 h-28 rounded-[16px] overflow-hidden bg-gray-50 shrink-0", children: /* @__PURE__ */ jsx(
|
|
15450
15444
|
Image4,
|
|
@@ -15499,7 +15493,7 @@ function CartItem({ item }) {
|
|
|
15499
15493
|
)
|
|
15500
15494
|
] }),
|
|
15501
15495
|
/* @__PURE__ */ jsxs("div", { className: "text-right", children: [
|
|
15502
|
-
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-
|
|
15496
|
+
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-secondary", children: formatPrice(itemTotal) }),
|
|
15503
15497
|
/* @__PURE__ */ jsxs("p", { className: "font-['Poppins',sans-serif] text-[11px] text-[#676c80]", children: [
|
|
15504
15498
|
formatPrice(unitPrice),
|
|
15505
15499
|
" each"
|
|
@@ -15535,7 +15529,7 @@ function CartScreen() {
|
|
|
15535
15529
|
{
|
|
15536
15530
|
type: "button",
|
|
15537
15531
|
onClick: () => router.push(buildPath("/shop")),
|
|
15538
|
-
className: "rounded-xl border-2 border-primary bg-
|
|
15532
|
+
className: "rounded-xl border-2 border-primary bg-secondary text-white px-6 py-3 text-sm font-medium transition-colors flex items-center justify-center gap-2 hover:opacity-80",
|
|
15539
15533
|
children: [
|
|
15540
15534
|
"Discover products",
|
|
15541
15535
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-5 w-5" })
|
|
@@ -15609,7 +15603,7 @@ function CartScreen() {
|
|
|
15609
15603
|
animate: { opacity: 1, y: 0 },
|
|
15610
15604
|
transition: { delay: 0.1 },
|
|
15611
15605
|
className: "space-y-6 lg:sticky lg:top-24 h-fit lg:col-span-1",
|
|
15612
|
-
children: /* @__PURE__ */ jsxs("div", { className: "bg-linear-to-br from-
|
|
15606
|
+
children: /* @__PURE__ */ jsxs("div", { className: "bg-linear-to-br from-secondary/10 to-secondary/10 rounded-[24px] p-8 border-2 border-secondary/20 sticky top-24", children: [
|
|
15613
15607
|
/* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6", children: "Order Summary" }),
|
|
15614
15608
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-6", children: [
|
|
15615
15609
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -15637,7 +15631,7 @@ function CartScreen() {
|
|
|
15637
15631
|
{
|
|
15638
15632
|
type: "submit",
|
|
15639
15633
|
onClick: handleSubmit,
|
|
15640
|
-
className: "w-full rounded-full border-2 border-
|
|
15634
|
+
className: "w-full rounded-full border-2 border-secondary bg-secondary hover:bg-secondary/80 text-white px-4 py-3 text-sm font-medium transition-colors flex items-center justify-center gap-2",
|
|
15641
15635
|
children: [
|
|
15642
15636
|
"Proceed to Checkout",
|
|
15643
15637
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-5 w-5" })
|
|
@@ -16947,8 +16941,8 @@ function CheckoutScreen() {
|
|
|
16947
16941
|
animate: { opacity: 1, y: 0 },
|
|
16948
16942
|
transition: { duration: 0.5, ease: "easeOut", delay: 0.1 },
|
|
16949
16943
|
className: "space-y-10 lg:sticky lg:top-24 lg:col-span-1",
|
|
16950
|
-
children: /* @__PURE__ */ jsxs("div", { className: "bg-linear-to-br from-
|
|
16951
|
-
/* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-
|
|
16944
|
+
children: /* @__PURE__ */ jsxs("div", { className: "bg-linear-to-br from-secondary/10 to-secondary/10 rounded-[24px] p-8 border-2 border-secondary/20 sticky top-24", children: [
|
|
16945
|
+
/* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6 text-2xl", children: "Order Summary" }),
|
|
16952
16946
|
/* @__PURE__ */ jsxs("section", { className: "mt-8 pt-6 border-t border-slate-100", children: [
|
|
16953
16947
|
/* @__PURE__ */ jsx("div", { className: "space-y-4 mb-6", children: cart?.cartBody?.items?.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
16954
16948
|
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-xl overflow-hidden bg-white shrink-0", children: /* @__PURE__ */ jsx(Image4, { src: item.productVariantData?.media?.[0]?.file || PLACEHOLDER_IMAGE_SRC, alt: item.productVariantData.name, className: "w-full h-full object-cover", height: 200, width: 200 }) }),
|
|
@@ -16959,10 +16953,10 @@ function CheckoutScreen() {
|
|
|
16959
16953
|
" \u2022 Qty: ",
|
|
16960
16954
|
item.quantity
|
|
16961
16955
|
] }),
|
|
16962
|
-
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-
|
|
16956
|
+
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-secondary mt-1", children: formatPrice(item.productVariantData.finalPrice * item.quantity) })
|
|
16963
16957
|
] })
|
|
16964
16958
|
] }, item.productVariantId || item.id)) }),
|
|
16965
|
-
/* @__PURE__ */ jsx("div", { className: "h-px bg-
|
|
16959
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-secondary/20 my-4" }),
|
|
16966
16960
|
/* @__PURE__ */ jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsx(
|
|
16967
16961
|
CouponCodeInput,
|
|
16968
16962
|
{
|
|
@@ -16994,14 +16988,14 @@ function CheckoutScreen() {
|
|
|
16994
16988
|
/* @__PURE__ */ jsx("span", { children: "Estimated tax" }),
|
|
16995
16989
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: formatPrice(tax) })
|
|
16996
16990
|
] }),
|
|
16997
|
-
/* @__PURE__ */ jsx("div", { className: "h-px bg-
|
|
16991
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-secondary/20 mt-6" }),
|
|
16998
16992
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
16999
|
-
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-semibold text-[16px] text-
|
|
17000
|
-
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-bold text-[24px] text-
|
|
16993
|
+
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-semibold text-[16px] text-secondary", children: "Total" }),
|
|
16994
|
+
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-bold text-[24px] text-secondary", children: formatPrice(total) })
|
|
17001
16995
|
] })
|
|
17002
16996
|
] }),
|
|
17003
16997
|
/* @__PURE__ */ jsx("div", { className: "bg-white/80 rounded-xl p-4", children: /* @__PURE__ */ jsxs("p", { className: "font-['Poppins',sans-serif] text-[11px] text-[#676c80] leading-[1.6]", children: [
|
|
17004
|
-
/* @__PURE__ */ jsx("strong", { className: "text-
|
|
16998
|
+
/* @__PURE__ */ jsx("strong", { className: "text-secondary", children: "Payment:" }),
|
|
17005
16999
|
" We'll contact you to arrange payment upon pickup or delivery. We accept cash, credit cards, and all major payment methods."
|
|
17006
17000
|
] }) })
|
|
17007
17001
|
] }),
|
|
@@ -17037,7 +17031,7 @@ function CheckoutScreen() {
|
|
|
17037
17031
|
{
|
|
17038
17032
|
type: "submit",
|
|
17039
17033
|
disabled: isSubmitting,
|
|
17040
|
-
className: "font-['Poppins',sans-serif] font-medium text-[14px] px-6 py-3 rounded-full text-white hover:bg-[#d66f45] hover:shadow-lg transition-all duration-300 mt-4 w-full bg-
|
|
17034
|
+
className: "font-['Poppins',sans-serif] font-medium text-[14px] px-6 py-3 rounded-full text-white hover:bg-[#d66f45] hover:shadow-lg transition-all duration-300 mt-4 w-full bg-secondary hover:bg-[#2B4B7C] flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
17041
17035
|
children: [
|
|
17042
17036
|
/* @__PURE__ */ jsx(CreditCard, { className: "h-5 w-5" }),
|
|
17043
17037
|
isSubmitting ? "Placing order..." : "Place Secure Order"
|
|
@@ -17142,14 +17136,11 @@ function LoginScreen() {
|
|
|
17142
17136
|
boxShadow: "0px 4px 6px -4px #0000001A, 0px 10px 15px -3px #0000001A"
|
|
17143
17137
|
},
|
|
17144
17138
|
children: [
|
|
17145
|
-
status && /* @__PURE__ */
|
|
17139
|
+
status && /* @__PURE__ */ jsx(
|
|
17146
17140
|
"div",
|
|
17147
17141
|
{
|
|
17148
17142
|
className: `flex flex-row items-start gap-2 rounded-2xl border px-4 py-3 text-sm ${status.type === "success" ? "border-green-200 bg-green-50 text-green-800" : "border-red-200 bg-red-50 text-red-700"}`,
|
|
17149
|
-
children:
|
|
17150
|
-
/* @__PURE__ */ jsx("span", { className: " text-base", children: status.type === "success" ? "\u2714" : "!" }),
|
|
17151
|
-
/* @__PURE__ */ jsx("span", { children: status.message })
|
|
17152
|
-
]
|
|
17143
|
+
children: /* @__PURE__ */ jsx("span", { children: status.message })
|
|
17153
17144
|
}
|
|
17154
17145
|
),
|
|
17155
17146
|
/* @__PURE__ */ jsxs("div", { className: "text-start text-secondary", children: [
|
|
@@ -17192,26 +17183,14 @@ function LoginScreen() {
|
|
|
17192
17183
|
}
|
|
17193
17184
|
)
|
|
17194
17185
|
] }),
|
|
17195
|
-
/* @__PURE__ */
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
|
|
17200
|
-
|
|
17201
|
-
|
|
17202
|
-
|
|
17203
|
-
),
|
|
17204
|
-
"Remember me"
|
|
17205
|
-
] }),
|
|
17206
|
-
/* @__PURE__ */ jsx(
|
|
17207
|
-
Link9,
|
|
17208
|
-
{
|
|
17209
|
-
href: buildPath("/forgot-password"),
|
|
17210
|
-
className: "font-medium text-primary transition hover:opacity-80",
|
|
17211
|
-
children: "Forgot password?"
|
|
17212
|
-
}
|
|
17213
|
-
)
|
|
17214
|
-
] }),
|
|
17186
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end text-sm", children: /* @__PURE__ */ jsx(
|
|
17187
|
+
Link9,
|
|
17188
|
+
{
|
|
17189
|
+
href: buildPath("/forgot-password"),
|
|
17190
|
+
className: "font-medium text-primary transition hover:opacity-80",
|
|
17191
|
+
children: "Forgot password?"
|
|
17192
|
+
}
|
|
17193
|
+
) }),
|
|
17215
17194
|
/* @__PURE__ */ jsx(
|
|
17216
17195
|
"button",
|
|
17217
17196
|
{
|
|
@@ -17982,7 +17961,7 @@ function AccountOverviewTab() {
|
|
|
17982
17961
|
] }),
|
|
17983
17962
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
17984
17963
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
17985
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(User, { className: "h-5 w-5 text-
|
|
17964
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(User, { className: "h-5 w-5 text-secondary" }) }),
|
|
17986
17965
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17987
17966
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Full Name" }),
|
|
17988
17967
|
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-secondary", children: [
|
|
@@ -17993,21 +17972,21 @@ function AccountOverviewTab() {
|
|
|
17993
17972
|
] })
|
|
17994
17973
|
] }),
|
|
17995
17974
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
17996
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(Mail, { className: "h-5 w-5 text-
|
|
17975
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(Mail, { className: "h-5 w-5 text-secondary" }) }),
|
|
17997
17976
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17998
17977
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "E-mail Address" }),
|
|
17999
17978
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: user.email })
|
|
18000
17979
|
] })
|
|
18001
17980
|
] }),
|
|
18002
17981
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
18003
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(Phone, { className: "h-5 w-5 text-
|
|
17982
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(Phone, { className: "h-5 w-5 text-secondary" }) }),
|
|
18004
17983
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
18005
17984
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Phone Number" }),
|
|
18006
17985
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: user.phoneNumber || "Not provided" })
|
|
18007
17986
|
] })
|
|
18008
17987
|
] }),
|
|
18009
17988
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
18010
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(MapPin, { className: "h-5 w-5 text-
|
|
17989
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsx(MapPin, { className: "h-5 w-5 text-secondary" }) }),
|
|
18011
17990
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
18012
17991
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Date of Birth" }),
|
|
18013
17992
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: "Not provided" })
|
|
@@ -18039,7 +18018,8 @@ function AccountOverviewTab() {
|
|
|
18039
18018
|
)) }) : recentOrders.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted text-center py-8", children: "No orders yet" }) : /* @__PURE__ */ jsx("div", { className: "space-y-3", children: recentOrders.map((order) => /* @__PURE__ */ jsxs(
|
|
18040
18019
|
"div",
|
|
18041
18020
|
{
|
|
18042
|
-
|
|
18021
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18022
|
+
className: "flex items-center justify-between rounded-lg bg-slate-50 p-4 hover:bg-slate-100 transition-colors cursor-pointer",
|
|
18043
18023
|
children: [
|
|
18044
18024
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
18045
18025
|
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-white", children: /* @__PURE__ */ jsx(Package, { className: "h-5 w-5 text-slate-600" }) }),
|
|
@@ -18071,6 +18051,8 @@ function AccountOverviewTab() {
|
|
|
18071
18051
|
}
|
|
18072
18052
|
function AccountOrdersTab() {
|
|
18073
18053
|
const { orders, isLoading, error } = useCurrentOrders();
|
|
18054
|
+
const router = useRouter();
|
|
18055
|
+
const { buildPath } = useBasePath();
|
|
18074
18056
|
if (isLoading) {
|
|
18075
18057
|
return /* @__PURE__ */ jsx("div", { className: "py-6 px-3 pb-24", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsx(
|
|
18076
18058
|
"div",
|
|
@@ -18098,7 +18080,8 @@ function AccountOrdersTab() {
|
|
|
18098
18080
|
return /* @__PURE__ */ jsxs(
|
|
18099
18081
|
"div",
|
|
18100
18082
|
{
|
|
18101
|
-
|
|
18083
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18084
|
+
className: "rounded-xl border border-slate-200 bg-white p-6 hover:shadow-md transition-shadow cursor-pointer",
|
|
18102
18085
|
children: [
|
|
18103
18086
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4 pb-4 border-b border-slate-200", children: [
|
|
18104
18087
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -18538,7 +18521,7 @@ function AccountReviewsTab() {
|
|
|
18538
18521
|
"button",
|
|
18539
18522
|
{
|
|
18540
18523
|
onClick: () => router.push(buildPath("/reviews")),
|
|
18541
|
-
className: "inline-flex items-center gap-2 px-4 py-2 border border-
|
|
18524
|
+
className: "inline-flex items-center gap-2 px-4 py-2 border border-secondary text-secondary rounded-lg font-medium hover:bg-secondary/5 transition-colors text-sm",
|
|
18542
18525
|
children: [
|
|
18543
18526
|
/* @__PURE__ */ jsx(MessageSquare, { className: "size-4" }),
|
|
18544
18527
|
"Write a Review"
|
|
@@ -19913,7 +19896,7 @@ function WishlistScreen() {
|
|
|
19913
19896
|
{
|
|
19914
19897
|
type: "button",
|
|
19915
19898
|
onClick: () => router.push(buildPath("/shop")),
|
|
19916
|
-
className: "rounded-xl border-2 border-
|
|
19899
|
+
className: "rounded-xl border-2 border-secondary bg-secondary text-white px-6 py-3 text-sm font-medium transition-colors flex items-center justify-center gap-2 hover:opacity-80",
|
|
19917
19900
|
children: "Discover products"
|
|
19918
19901
|
}
|
|
19919
19902
|
) })
|
|
@@ -21304,6 +21287,23 @@ function OrderDetailScreen({ id }) {
|
|
|
21304
21287
|
const router = useRouter();
|
|
21305
21288
|
const { buildPath } = useBasePath();
|
|
21306
21289
|
const { order, isLoading, error } = useOrder(id);
|
|
21290
|
+
const [storeAddress, setStoreAddress] = useState(null);
|
|
21291
|
+
useEffect(() => {
|
|
21292
|
+
if (order && order.orderType !== "Delivery" && !order.pickUpAddress) {
|
|
21293
|
+
const fetchStoreAddress = async () => {
|
|
21294
|
+
try {
|
|
21295
|
+
const api = new ShippingApi(AXIOS_CONFIG);
|
|
21296
|
+
const res = await api.getStoreAddress();
|
|
21297
|
+
if (res.data) {
|
|
21298
|
+
setStoreAddress(res.data);
|
|
21299
|
+
}
|
|
21300
|
+
} catch (e) {
|
|
21301
|
+
console.error("Failed to fetch store address:", e);
|
|
21302
|
+
}
|
|
21303
|
+
};
|
|
21304
|
+
fetchStoreAddress();
|
|
21305
|
+
}
|
|
21306
|
+
}, [order]);
|
|
21307
21307
|
if (isLoading) {
|
|
21308
21308
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-slate-50 flex flex-col items-center justify-center p-4", children: [
|
|
21309
21309
|
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 border-4 border-primary-20 border-t-primary rounded-full animate-spin mb-4" }),
|
|
@@ -21338,7 +21338,7 @@ function OrderDetailScreen({ id }) {
|
|
|
21338
21338
|
}
|
|
21339
21339
|
};
|
|
21340
21340
|
const shippingAddress = order.shippingInfo?.addressTo;
|
|
21341
|
-
const pickupAddress = order.pickUpAddress;
|
|
21341
|
+
const pickupAddress = order.pickUpAddress || storeAddress;
|
|
21342
21342
|
const activeAddress = isDelivery ? shippingAddress : pickupAddress;
|
|
21343
21343
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-linear-to-b from-[#F8FAFC] to-[#EBF4FB] pb-20", children: [
|
|
21344
21344
|
/* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 pt-8 max-w-6xl", children: [
|