hey-pharmacist-ecommerce 1.1.38 → 1.1.40
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 +95 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -70
- 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 +47 -25
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React10, { createContext, forwardRef, useContext, useEffect, useState, useCallback, useRef, useMemo } from 'react';
|
|
2
|
+
import React10, { createContext, forwardRef, useContext, useLayoutEffect, useEffect, useState, useCallback, useRef, useMemo } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import globalAxios21 from 'axios';
|
|
5
5
|
import { motion, AnimatePresence, useMotionValue, useTransform } from 'framer-motion';
|
|
@@ -226,12 +226,41 @@ function useTheme() {
|
|
|
226
226
|
}
|
|
227
227
|
return context;
|
|
228
228
|
}
|
|
229
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
229
230
|
function ThemeProvider({ config, children }) {
|
|
230
|
-
|
|
231
|
+
const cssVariables = React10.useMemo(() => {
|
|
231
232
|
const primaryShades = generateColorShades(config.colors.primary);
|
|
232
233
|
const secondaryShades = generateColorShades(config.colors.secondary);
|
|
233
234
|
const accentShades = generateColorShades(config.colors.accent);
|
|
235
|
+
const vars = [];
|
|
236
|
+
vars.push(`--color-primary: ${config.colors.primary}`);
|
|
237
|
+
vars.push(`--color-primary-dark: ${config.colors.primaryDark}`);
|
|
238
|
+
vars.push(`--color-secondary: ${config.colors.secondary}`);
|
|
239
|
+
vars.push(`--color-accent: ${config.colors.accent}`);
|
|
240
|
+
vars.push(`--color-accent-dark: ${config.colors.accentDark}`);
|
|
241
|
+
vars.push(`--color-text-muted: ${config.colors.textMuted}`);
|
|
242
|
+
Object.entries(primaryShades).forEach(([shade, rgb]) => {
|
|
243
|
+
vars.push(`--color-primary-${shade}: ${rgb}`);
|
|
244
|
+
});
|
|
245
|
+
Object.entries(secondaryShades).forEach(([shade, rgb]) => {
|
|
246
|
+
vars.push(`--color-secondary-${shade}: ${rgb}`);
|
|
247
|
+
});
|
|
248
|
+
Object.entries(accentShades).forEach(([shade, rgb]) => {
|
|
249
|
+
vars.push(`--color-accent-${shade}: ${rgb}`);
|
|
250
|
+
});
|
|
251
|
+
return vars.join("; ");
|
|
252
|
+
}, [config.colors]);
|
|
253
|
+
useIsomorphicLayoutEffect(() => {
|
|
234
254
|
const root = document.documentElement;
|
|
255
|
+
const primaryShades = generateColorShades(config.colors.primary);
|
|
256
|
+
const secondaryShades = generateColorShades(config.colors.secondary);
|
|
257
|
+
const accentShades = generateColorShades(config.colors.accent);
|
|
258
|
+
root.style.setProperty("--color-primary", config.colors.primary);
|
|
259
|
+
root.style.setProperty("--color-primary-dark", config.colors.primaryDark);
|
|
260
|
+
root.style.setProperty("--color-secondary", config.colors.secondary);
|
|
261
|
+
root.style.setProperty("--color-accent", config.colors.accent);
|
|
262
|
+
root.style.setProperty("--color-accent-dark", config.colors.accentDark);
|
|
263
|
+
root.style.setProperty("--color-text-muted", config.colors.textMuted);
|
|
235
264
|
Object.entries(primaryShades).forEach(([shade, rgb]) => {
|
|
236
265
|
root.style.setProperty(`--color-primary-${shade}`, rgb);
|
|
237
266
|
});
|
|
@@ -241,20 +270,11 @@ function ThemeProvider({ config, children }) {
|
|
|
241
270
|
Object.entries(accentShades).forEach(([shade, rgb]) => {
|
|
242
271
|
root.style.setProperty(`--color-accent-${shade}`, rgb);
|
|
243
272
|
});
|
|
244
|
-
if (config.headerGradient) {
|
|
245
|
-
const [fr, fg, fb] = hexToRgb(config.headerGradient.from);
|
|
246
|
-
const [vr, vg, vb] = hexToRgb(config.headerGradient.via);
|
|
247
|
-
const [tr, tg, tb] = hexToRgb(config.headerGradient.to);
|
|
248
|
-
root.style.setProperty(`--header-from`, `${fr} ${fg} ${fb}`);
|
|
249
|
-
root.style.setProperty(`--header-via`, `${vr} ${vg} ${vb}`);
|
|
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
|
-
}
|
|
256
273
|
}, [config]);
|
|
257
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ jsxs(ThemeContext.Provider, { value: { config }, children: [
|
|
275
|
+
/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: `:root { ${cssVariables} }` } }),
|
|
276
|
+
children
|
|
277
|
+
] });
|
|
258
278
|
}
|
|
259
279
|
|
|
260
280
|
// src/providers/AuthProvider.tsx
|
|
@@ -13032,7 +13052,7 @@ function ProductCard({
|
|
|
13032
13052
|
/* @__PURE__ */ jsxs(
|
|
13033
13053
|
motion.div,
|
|
13034
13054
|
{
|
|
13035
|
-
className: "bg-white rounded-[16px] overflow-hidden border-2 border-gray-100 hover:border-
|
|
13055
|
+
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
13056
|
whileHover: { y: -4 },
|
|
13037
13057
|
onMouseEnter: () => setIsHovered(true),
|
|
13038
13058
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -13084,7 +13104,7 @@ function ProductCard({
|
|
|
13084
13104
|
displayDiscountAmount,
|
|
13085
13105
|
"%"
|
|
13086
13106
|
] }) }) }),
|
|
13087
|
-
/* @__PURE__ */ jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] text-xs text-
|
|
13107
|
+
/* @__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
13108
|
/* @__PURE__ */ jsxs("div", { className: "h-[40px] mb-3", children: [
|
|
13089
13109
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] line-clamp-2", children: product.name }),
|
|
13090
13110
|
selectedVariant && /* @__PURE__ */ jsx("p", { className: "text-xs font-['Poppins',sans-serif] text-[#676c80]", children: selectedVariant.name })
|
|
@@ -13183,7 +13203,7 @@ function ProductCard({
|
|
|
13183
13203
|
}
|
|
13184
13204
|
},
|
|
13185
13205
|
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-
|
|
13206
|
+
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
13207
|
children: [
|
|
13188
13208
|
/* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }),
|
|
13189
13209
|
displayInventoryCount === 0 ? "Out of Stock" : "Add to Cart"
|
|
@@ -14728,7 +14748,7 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14728
14748
|
return /* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-lg p-4 bg-white", children: [
|
|
14729
14749
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-3", children: [
|
|
14730
14750
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
14731
|
-
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 bg-
|
|
14751
|
+
/* @__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
14752
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
14733
14753
|
/* @__PURE__ */ jsx("p", { className: "font-medium text-gray-900", children: "Customer Review" }),
|
|
14734
14754
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: formatDistanceToNow(reviewDate, { addSuffix: true }) })
|
|
@@ -14738,9 +14758,9 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14738
14758
|
] }),
|
|
14739
14759
|
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
14760
|
/* @__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-
|
|
14761
|
+
review.reply && /* @__PURE__ */ jsxs("div", { className: "mt-4 pl-4 border-l-2 border-secondary bg-gray-50 p-3 rounded", children: [
|
|
14742
14762
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
14743
|
-
/* @__PURE__ */ jsx(MessageCircle, { className: "size-4 text-
|
|
14763
|
+
/* @__PURE__ */ jsx(MessageCircle, { className: "size-4 text-secondary" }),
|
|
14744
14764
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-gray-900", children: "Store Response" }),
|
|
14745
14765
|
replyDate && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: formatDistanceToNow(replyDate, { addSuffix: true }) })
|
|
14746
14766
|
] }),
|
|
@@ -15334,7 +15354,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
15334
15354
|
)
|
|
15335
15355
|
] })
|
|
15336
15356
|
] }),
|
|
15337
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 p-6 bg-linear-to-br from-
|
|
15357
|
+
/* @__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
15358
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
15339
15359
|
/* @__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
15360
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -15444,7 +15464,7 @@ function CartItem({ item }) {
|
|
|
15444
15464
|
initial: { opacity: 0, y: 20 },
|
|
15445
15465
|
animate: { opacity: 1, y: 0 },
|
|
15446
15466
|
exit: { opacity: 0, x: -100 },
|
|
15447
|
-
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-
|
|
15467
|
+
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-secondary/30 transition-all duration-300",
|
|
15448
15468
|
children: /* @__PURE__ */ jsxs("div", { className: "flex gap-4 pr-8", children: [
|
|
15449
15469
|
/* @__PURE__ */ jsx("div", { className: "w-28 h-28 rounded-[16px] overflow-hidden bg-gray-50 shrink-0", children: /* @__PURE__ */ jsx(
|
|
15450
15470
|
Image4,
|
|
@@ -15499,7 +15519,7 @@ function CartItem({ item }) {
|
|
|
15499
15519
|
)
|
|
15500
15520
|
] }),
|
|
15501
15521
|
/* @__PURE__ */ jsxs("div", { className: "text-right", children: [
|
|
15502
|
-
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-
|
|
15522
|
+
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-secondary", children: formatPrice(itemTotal) }),
|
|
15503
15523
|
/* @__PURE__ */ jsxs("p", { className: "font-['Poppins',sans-serif] text-[11px] text-[#676c80]", children: [
|
|
15504
15524
|
formatPrice(unitPrice),
|
|
15505
15525
|
" each"
|
|
@@ -15535,7 +15555,7 @@ function CartScreen() {
|
|
|
15535
15555
|
{
|
|
15536
15556
|
type: "button",
|
|
15537
15557
|
onClick: () => router.push(buildPath("/shop")),
|
|
15538
|
-
className: "rounded-xl border-2 border-primary bg-
|
|
15558
|
+
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
15559
|
children: [
|
|
15540
15560
|
"Discover products",
|
|
15541
15561
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-5 w-5" })
|
|
@@ -15609,7 +15629,7 @@ function CartScreen() {
|
|
|
15609
15629
|
animate: { opacity: 1, y: 0 },
|
|
15610
15630
|
transition: { delay: 0.1 },
|
|
15611
15631
|
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-
|
|
15632
|
+
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
15633
|
/* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6", children: "Order Summary" }),
|
|
15614
15634
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-6", children: [
|
|
15615
15635
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -15637,7 +15657,7 @@ function CartScreen() {
|
|
|
15637
15657
|
{
|
|
15638
15658
|
type: "submit",
|
|
15639
15659
|
onClick: handleSubmit,
|
|
15640
|
-
className: "w-full rounded-full border-2 border-
|
|
15660
|
+
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
15661
|
children: [
|
|
15642
15662
|
"Proceed to Checkout",
|
|
15643
15663
|
/* @__PURE__ */ jsx(ArrowRight, { className: "h-5 w-5" })
|
|
@@ -16947,8 +16967,8 @@ function CheckoutScreen() {
|
|
|
16947
16967
|
animate: { opacity: 1, y: 0 },
|
|
16948
16968
|
transition: { duration: 0.5, ease: "easeOut", delay: 0.1 },
|
|
16949
16969
|
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-
|
|
16970
|
+
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: [
|
|
16971
|
+
/* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6 text-2xl", children: "Order Summary" }),
|
|
16952
16972
|
/* @__PURE__ */ jsxs("section", { className: "mt-8 pt-6 border-t border-slate-100", children: [
|
|
16953
16973
|
/* @__PURE__ */ jsx("div", { className: "space-y-4 mb-6", children: cart?.cartBody?.items?.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
16954
16974
|
/* @__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 +16979,10 @@ function CheckoutScreen() {
|
|
|
16959
16979
|
" \u2022 Qty: ",
|
|
16960
16980
|
item.quantity
|
|
16961
16981
|
] }),
|
|
16962
|
-
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-
|
|
16982
|
+
/* @__PURE__ */ jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-secondary mt-1", children: formatPrice(item.productVariantData.finalPrice * item.quantity) })
|
|
16963
16983
|
] })
|
|
16964
16984
|
] }, item.productVariantId || item.id)) }),
|
|
16965
|
-
/* @__PURE__ */ jsx("div", { className: "h-px bg-
|
|
16985
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-secondary/20 my-4" }),
|
|
16966
16986
|
/* @__PURE__ */ jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsx(
|
|
16967
16987
|
CouponCodeInput,
|
|
16968
16988
|
{
|
|
@@ -16994,14 +17014,14 @@ function CheckoutScreen() {
|
|
|
16994
17014
|
/* @__PURE__ */ jsx("span", { children: "Estimated tax" }),
|
|
16995
17015
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: formatPrice(tax) })
|
|
16996
17016
|
] }),
|
|
16997
|
-
/* @__PURE__ */ jsx("div", { className: "h-px bg-
|
|
17017
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-secondary/20 mt-6" }),
|
|
16998
17018
|
/* @__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-
|
|
17019
|
+
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-semibold text-[16px] text-secondary", children: "Total" }),
|
|
17020
|
+
/* @__PURE__ */ jsx("span", { className: "font-['Poppins',sans-serif] font-bold text-[24px] text-secondary", children: formatPrice(total) })
|
|
17001
17021
|
] })
|
|
17002
17022
|
] }),
|
|
17003
17023
|
/* @__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-
|
|
17024
|
+
/* @__PURE__ */ jsx("strong", { className: "text-secondary", children: "Payment:" }),
|
|
17005
17025
|
" We'll contact you to arrange payment upon pickup or delivery. We accept cash, credit cards, and all major payment methods."
|
|
17006
17026
|
] }) })
|
|
17007
17027
|
] }),
|
|
@@ -17037,7 +17057,7 @@ function CheckoutScreen() {
|
|
|
17037
17057
|
{
|
|
17038
17058
|
type: "submit",
|
|
17039
17059
|
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-
|
|
17060
|
+
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
17061
|
children: [
|
|
17042
17062
|
/* @__PURE__ */ jsx(CreditCard, { className: "h-5 w-5" }),
|
|
17043
17063
|
isSubmitting ? "Placing order..." : "Place Secure Order"
|
|
@@ -17142,14 +17162,11 @@ function LoginScreen() {
|
|
|
17142
17162
|
boxShadow: "0px 4px 6px -4px #0000001A, 0px 10px 15px -3px #0000001A"
|
|
17143
17163
|
},
|
|
17144
17164
|
children: [
|
|
17145
|
-
status && /* @__PURE__ */
|
|
17165
|
+
status && /* @__PURE__ */ jsx(
|
|
17146
17166
|
"div",
|
|
17147
17167
|
{
|
|
17148
17168
|
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
|
-
]
|
|
17169
|
+
children: /* @__PURE__ */ jsx("span", { children: status.message })
|
|
17153
17170
|
}
|
|
17154
17171
|
),
|
|
17155
17172
|
/* @__PURE__ */ jsxs("div", { className: "text-start text-secondary", children: [
|
|
@@ -17192,26 +17209,14 @@ function LoginScreen() {
|
|
|
17192
17209
|
}
|
|
17193
17210
|
)
|
|
17194
17211
|
] }),
|
|
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
|
-
] }),
|
|
17212
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end text-sm", children: /* @__PURE__ */ jsx(
|
|
17213
|
+
Link9,
|
|
17214
|
+
{
|
|
17215
|
+
href: buildPath("/forgot-password"),
|
|
17216
|
+
className: "font-medium text-primary transition hover:opacity-80",
|
|
17217
|
+
children: "Forgot password?"
|
|
17218
|
+
}
|
|
17219
|
+
) }),
|
|
17215
17220
|
/* @__PURE__ */ jsx(
|
|
17216
17221
|
"button",
|
|
17217
17222
|
{
|
|
@@ -17982,7 +17987,7 @@ function AccountOverviewTab() {
|
|
|
17982
17987
|
] }),
|
|
17983
17988
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
17984
17989
|
/* @__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-
|
|
17990
|
+
/* @__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
17991
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17987
17992
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Full Name" }),
|
|
17988
17993
|
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-secondary", children: [
|
|
@@ -17993,21 +17998,21 @@ function AccountOverviewTab() {
|
|
|
17993
17998
|
] })
|
|
17994
17999
|
] }),
|
|
17995
18000
|
/* @__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-
|
|
18001
|
+
/* @__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
18002
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17998
18003
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "E-mail Address" }),
|
|
17999
18004
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: user.email })
|
|
18000
18005
|
] })
|
|
18001
18006
|
] }),
|
|
18002
18007
|
/* @__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-
|
|
18008
|
+
/* @__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
18009
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
18005
18010
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Phone Number" }),
|
|
18006
18011
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: user.phoneNumber || "Not provided" })
|
|
18007
18012
|
] })
|
|
18008
18013
|
] }),
|
|
18009
18014
|
/* @__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-
|
|
18015
|
+
/* @__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
18016
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
18012
18017
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted", children: "Date of Birth" }),
|
|
18013
18018
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-secondary", children: "Not provided" })
|
|
@@ -18039,7 +18044,8 @@ function AccountOverviewTab() {
|
|
|
18039
18044
|
)) }) : 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
18045
|
"div",
|
|
18041
18046
|
{
|
|
18042
|
-
|
|
18047
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18048
|
+
className: "flex items-center justify-between rounded-lg bg-slate-50 p-4 hover:bg-slate-100 transition-colors cursor-pointer",
|
|
18043
18049
|
children: [
|
|
18044
18050
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
18045
18051
|
/* @__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 +18077,8 @@ function AccountOverviewTab() {
|
|
|
18071
18077
|
}
|
|
18072
18078
|
function AccountOrdersTab() {
|
|
18073
18079
|
const { orders, isLoading, error } = useCurrentOrders();
|
|
18080
|
+
const router = useRouter();
|
|
18081
|
+
const { buildPath } = useBasePath();
|
|
18074
18082
|
if (isLoading) {
|
|
18075
18083
|
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
18084
|
"div",
|
|
@@ -18098,7 +18106,8 @@ function AccountOrdersTab() {
|
|
|
18098
18106
|
return /* @__PURE__ */ jsxs(
|
|
18099
18107
|
"div",
|
|
18100
18108
|
{
|
|
18101
|
-
|
|
18109
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18110
|
+
className: "rounded-xl border border-slate-200 bg-white p-6 hover:shadow-md transition-shadow cursor-pointer",
|
|
18102
18111
|
children: [
|
|
18103
18112
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4 pb-4 border-b border-slate-200", children: [
|
|
18104
18113
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -18538,7 +18547,7 @@ function AccountReviewsTab() {
|
|
|
18538
18547
|
"button",
|
|
18539
18548
|
{
|
|
18540
18549
|
onClick: () => router.push(buildPath("/reviews")),
|
|
18541
|
-
className: "inline-flex items-center gap-2 px-4 py-2 border border-
|
|
18550
|
+
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
18551
|
children: [
|
|
18543
18552
|
/* @__PURE__ */ jsx(MessageSquare, { className: "size-4" }),
|
|
18544
18553
|
"Write a Review"
|
|
@@ -19913,7 +19922,7 @@ function WishlistScreen() {
|
|
|
19913
19922
|
{
|
|
19914
19923
|
type: "button",
|
|
19915
19924
|
onClick: () => router.push(buildPath("/shop")),
|
|
19916
|
-
className: "rounded-xl border-2 border-
|
|
19925
|
+
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
19926
|
children: "Discover products"
|
|
19918
19927
|
}
|
|
19919
19928
|
) })
|
|
@@ -21304,6 +21313,23 @@ function OrderDetailScreen({ id }) {
|
|
|
21304
21313
|
const router = useRouter();
|
|
21305
21314
|
const { buildPath } = useBasePath();
|
|
21306
21315
|
const { order, isLoading, error } = useOrder(id);
|
|
21316
|
+
const [storeAddress, setStoreAddress] = useState(null);
|
|
21317
|
+
useEffect(() => {
|
|
21318
|
+
if (order && order.orderType !== "Delivery" && !order.pickUpAddress) {
|
|
21319
|
+
const fetchStoreAddress = async () => {
|
|
21320
|
+
try {
|
|
21321
|
+
const api = new ShippingApi(AXIOS_CONFIG);
|
|
21322
|
+
const res = await api.getStoreAddress();
|
|
21323
|
+
if (res.data) {
|
|
21324
|
+
setStoreAddress(res.data);
|
|
21325
|
+
}
|
|
21326
|
+
} catch (e) {
|
|
21327
|
+
console.error("Failed to fetch store address:", e);
|
|
21328
|
+
}
|
|
21329
|
+
};
|
|
21330
|
+
fetchStoreAddress();
|
|
21331
|
+
}
|
|
21332
|
+
}, [order]);
|
|
21307
21333
|
if (isLoading) {
|
|
21308
21334
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-slate-50 flex flex-col items-center justify-center p-4", children: [
|
|
21309
21335
|
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 border-4 border-primary-20 border-t-primary rounded-full animate-spin mb-4" }),
|
|
@@ -21338,7 +21364,7 @@ function OrderDetailScreen({ id }) {
|
|
|
21338
21364
|
}
|
|
21339
21365
|
};
|
|
21340
21366
|
const shippingAddress = order.shippingInfo?.addressTo;
|
|
21341
|
-
const pickupAddress = order.pickUpAddress;
|
|
21367
|
+
const pickupAddress = order.pickUpAddress || storeAddress;
|
|
21342
21368
|
const activeAddress = isDelivery ? shippingAddress : pickupAddress;
|
|
21343
21369
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-linear-to-b from-[#F8FAFC] to-[#EBF4FB] pb-20", children: [
|
|
21344
21370
|
/* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 pt-8 max-w-6xl", children: [
|