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/README.md
CHANGED
|
@@ -91,9 +91,6 @@ export default function ShopPage() {
|
|
|
91
91
|
|
|
92
92
|
The package exposes CSS variables for theme colors and a dynamic header gradient. Update via `EcommerceConfig`:
|
|
93
93
|
|
|
94
|
-
```ts
|
|
95
|
-
headerGradient?: { from: string; via: string; to: string } // hex colors
|
|
96
|
-
```
|
|
97
94
|
|
|
98
95
|
Under the hood, `ThemeProvider` sets `--color-<brand>-<shade>` and:
|
|
99
96
|
|
package/dist/index.d.mts
CHANGED
|
@@ -9,14 +9,11 @@ interface EcommerceConfig {
|
|
|
9
9
|
logo: string;
|
|
10
10
|
colors: {
|
|
11
11
|
primary: string;
|
|
12
|
+
primaryDark: string;
|
|
12
13
|
secondary: string;
|
|
13
14
|
accent: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
headerGradient?: {
|
|
17
|
-
from: string;
|
|
18
|
-
via: string;
|
|
19
|
-
to: string;
|
|
15
|
+
accentDark: string;
|
|
16
|
+
textMuted: string;
|
|
20
17
|
};
|
|
21
18
|
apiBaseUrl: string;
|
|
22
19
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,11 @@ interface EcommerceConfig {
|
|
|
9
9
|
logo: string;
|
|
10
10
|
colors: {
|
|
11
11
|
primary: string;
|
|
12
|
+
primaryDark: string;
|
|
12
13
|
secondary: string;
|
|
13
14
|
accent: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
headerGradient?: {
|
|
17
|
-
from: string;
|
|
18
|
-
via: string;
|
|
19
|
-
to: string;
|
|
15
|
+
accentDark: string;
|
|
16
|
+
textMuted: string;
|
|
20
17
|
};
|
|
21
18
|
apiBaseUrl: string;
|
|
22
19
|
}
|
package/dist/index.js
CHANGED
|
@@ -236,12 +236,41 @@ function useTheme() {
|
|
|
236
236
|
}
|
|
237
237
|
return context;
|
|
238
238
|
}
|
|
239
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React10.useLayoutEffect : React10.useEffect;
|
|
239
240
|
function ThemeProvider({ config, children }) {
|
|
240
|
-
|
|
241
|
+
const cssVariables = React10__default.default.useMemo(() => {
|
|
241
242
|
const primaryShades = generateColorShades(config.colors.primary);
|
|
242
243
|
const secondaryShades = generateColorShades(config.colors.secondary);
|
|
243
244
|
const accentShades = generateColorShades(config.colors.accent);
|
|
245
|
+
const vars = [];
|
|
246
|
+
vars.push(`--color-primary: ${config.colors.primary}`);
|
|
247
|
+
vars.push(`--color-primary-dark: ${config.colors.primaryDark}`);
|
|
248
|
+
vars.push(`--color-secondary: ${config.colors.secondary}`);
|
|
249
|
+
vars.push(`--color-accent: ${config.colors.accent}`);
|
|
250
|
+
vars.push(`--color-accent-dark: ${config.colors.accentDark}`);
|
|
251
|
+
vars.push(`--color-text-muted: ${config.colors.textMuted}`);
|
|
252
|
+
Object.entries(primaryShades).forEach(([shade, rgb]) => {
|
|
253
|
+
vars.push(`--color-primary-${shade}: ${rgb}`);
|
|
254
|
+
});
|
|
255
|
+
Object.entries(secondaryShades).forEach(([shade, rgb]) => {
|
|
256
|
+
vars.push(`--color-secondary-${shade}: ${rgb}`);
|
|
257
|
+
});
|
|
258
|
+
Object.entries(accentShades).forEach(([shade, rgb]) => {
|
|
259
|
+
vars.push(`--color-accent-${shade}: ${rgb}`);
|
|
260
|
+
});
|
|
261
|
+
return vars.join("; ");
|
|
262
|
+
}, [config.colors]);
|
|
263
|
+
useIsomorphicLayoutEffect(() => {
|
|
244
264
|
const root = document.documentElement;
|
|
265
|
+
const primaryShades = generateColorShades(config.colors.primary);
|
|
266
|
+
const secondaryShades = generateColorShades(config.colors.secondary);
|
|
267
|
+
const accentShades = generateColorShades(config.colors.accent);
|
|
268
|
+
root.style.setProperty("--color-primary", config.colors.primary);
|
|
269
|
+
root.style.setProperty("--color-primary-dark", config.colors.primaryDark);
|
|
270
|
+
root.style.setProperty("--color-secondary", config.colors.secondary);
|
|
271
|
+
root.style.setProperty("--color-accent", config.colors.accent);
|
|
272
|
+
root.style.setProperty("--color-accent-dark", config.colors.accentDark);
|
|
273
|
+
root.style.setProperty("--color-text-muted", config.colors.textMuted);
|
|
245
274
|
Object.entries(primaryShades).forEach(([shade, rgb]) => {
|
|
246
275
|
root.style.setProperty(`--color-primary-${shade}`, rgb);
|
|
247
276
|
});
|
|
@@ -251,20 +280,11 @@ function ThemeProvider({ config, children }) {
|
|
|
251
280
|
Object.entries(accentShades).forEach(([shade, rgb]) => {
|
|
252
281
|
root.style.setProperty(`--color-accent-${shade}`, rgb);
|
|
253
282
|
});
|
|
254
|
-
if (config.headerGradient) {
|
|
255
|
-
const [fr, fg, fb] = hexToRgb(config.headerGradient.from);
|
|
256
|
-
const [vr, vg, vb] = hexToRgb(config.headerGradient.via);
|
|
257
|
-
const [tr, tg, tb] = hexToRgb(config.headerGradient.to);
|
|
258
|
-
root.style.setProperty(`--header-from`, `${fr} ${fg} ${fb}`);
|
|
259
|
-
root.style.setProperty(`--header-via`, `${vr} ${vg} ${vb}`);
|
|
260
|
-
root.style.setProperty(`--header-to`, `${tr} ${tg} ${tb}`);
|
|
261
|
-
} else {
|
|
262
|
-
root.style.setProperty(`--header-from`, primaryShades[700]);
|
|
263
|
-
root.style.setProperty(`--header-via`, primaryShades[600]);
|
|
264
|
-
root.style.setProperty(`--header-to`, secondaryShades[600]);
|
|
265
|
-
}
|
|
266
283
|
}, [config]);
|
|
267
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
284
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ThemeContext.Provider, { value: { config }, children: [
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `:root { ${cssVariables} }` } }),
|
|
286
|
+
children
|
|
287
|
+
] });
|
|
268
288
|
}
|
|
269
289
|
|
|
270
290
|
// src/providers/AuthProvider.tsx
|
|
@@ -13042,7 +13062,7 @@ function ProductCard({
|
|
|
13042
13062
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13043
13063
|
framerMotion.motion.div,
|
|
13044
13064
|
{
|
|
13045
|
-
className: "bg-white rounded-[16px] overflow-hidden border-2 border-gray-100 hover:border-
|
|
13065
|
+
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",
|
|
13046
13066
|
whileHover: { y: -4 },
|
|
13047
13067
|
onMouseEnter: () => setIsHovered(true),
|
|
13048
13068
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -13094,7 +13114,7 @@ function ProductCard({
|
|
|
13094
13114
|
displayDiscountAmount,
|
|
13095
13115
|
"%"
|
|
13096
13116
|
] }) }) }),
|
|
13097
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] text-xs text-
|
|
13117
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] text-xs text-secondary uppercase tracking-wide font-medium", children: product.brand }) }),
|
|
13098
13118
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] mb-3", children: [
|
|
13099
13119
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] line-clamp-2", children: product.name }),
|
|
13100
13120
|
selectedVariant && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-['Poppins',sans-serif] text-[#676c80]", children: selectedVariant.name })
|
|
@@ -13193,7 +13213,7 @@ function ProductCard({
|
|
|
13193
13213
|
}
|
|
13194
13214
|
},
|
|
13195
13215
|
disabled: isAddingToCart || variantImages.length > 0 && !selectedVariantId || displayInventoryCount === 0,
|
|
13196
|
-
className: "w-full font-['Poppins',sans-serif] font-medium text-[11px] px-3 py-2 rounded-full bg-
|
|
13216
|
+
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",
|
|
13197
13217
|
children: [
|
|
13198
13218
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShoppingCart, { className: "h-4 w-4" }),
|
|
13199
13219
|
displayInventoryCount === 0 ? "Out of Stock" : "Add to Cart"
|
|
@@ -14738,7 +14758,7 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14738
14758
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-gray-200 rounded-lg p-4 bg-white", children: [
|
|
14739
14759
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-3", children: [
|
|
14740
14760
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
14741
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 bg-
|
|
14761
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 bg-secondary/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-5 text-secondary" }) }),
|
|
14742
14762
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
14743
14763
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-gray-900", children: "Customer Review" }),
|
|
14744
14764
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500", children: dateFns.formatDistanceToNow(reviewDate, { addSuffix: true }) })
|
|
@@ -14748,9 +14768,9 @@ function ReviewCard({ review, showProductInfo = false }) {
|
|
|
14748
14768
|
] }),
|
|
14749
14769
|
review.reviewType && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded mb-2", children: review.reviewType }),
|
|
14750
14770
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-700 text-sm leading-relaxed mb-3", children: review.review }),
|
|
14751
|
-
review.reply && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 pl-4 border-l-2 border-
|
|
14771
|
+
review.reply && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 pl-4 border-l-2 border-secondary bg-gray-50 p-3 rounded", children: [
|
|
14752
14772
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
14753
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircle, { className: "size-4 text-
|
|
14773
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircle, { className: "size-4 text-secondary" }),
|
|
14754
14774
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-gray-900", children: "Store Response" }),
|
|
14755
14775
|
replyDate && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500", children: dateFns.formatDistanceToNow(replyDate, { addSuffix: true }) })
|
|
14756
14776
|
] }),
|
|
@@ -15344,7 +15364,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
15344
15364
|
)
|
|
15345
15365
|
] })
|
|
15346
15366
|
] }),
|
|
15347
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 p-6 bg-linear-to-br from-
|
|
15367
|
+
/* @__PURE__ */ jsxRuntime.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: [
|
|
15348
15368
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
15349
15369
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-10 rounded-full bg-white flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Truck, { className: "size-5 text-primary" }) }),
|
|
15350
15370
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -15454,7 +15474,7 @@ function CartItem({ item }) {
|
|
|
15454
15474
|
initial: { opacity: 0, y: 20 },
|
|
15455
15475
|
animate: { opacity: 1, y: 0 },
|
|
15456
15476
|
exit: { opacity: 0, x: -100 },
|
|
15457
|
-
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-
|
|
15477
|
+
className: "bg-white border-2 border-gray-100 rounded-[24px] p-6 hover:border-secondary/30 transition-all duration-300",
|
|
15458
15478
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4 pr-8", children: [
|
|
15459
15479
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-28 h-28 rounded-[16px] overflow-hidden bg-gray-50 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15460
15480
|
Image4__default.default,
|
|
@@ -15509,7 +15529,7 @@ function CartItem({ item }) {
|
|
|
15509
15529
|
)
|
|
15510
15530
|
] }),
|
|
15511
15531
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right", children: [
|
|
15512
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-
|
|
15532
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] font-bold text-[18px] text-secondary", children: formatPrice(itemTotal) }),
|
|
15513
15533
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "font-['Poppins',sans-serif] text-[11px] text-[#676c80]", children: [
|
|
15514
15534
|
formatPrice(unitPrice),
|
|
15515
15535
|
" each"
|
|
@@ -15545,7 +15565,7 @@ function CartScreen() {
|
|
|
15545
15565
|
{
|
|
15546
15566
|
type: "button",
|
|
15547
15567
|
onClick: () => router.push(buildPath("/shop")),
|
|
15548
|
-
className: "rounded-xl border-2 border-primary bg-
|
|
15568
|
+
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",
|
|
15549
15569
|
children: [
|
|
15550
15570
|
"Discover products",
|
|
15551
15571
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "h-5 w-5" })
|
|
@@ -15619,7 +15639,7 @@ function CartScreen() {
|
|
|
15619
15639
|
animate: { opacity: 1, y: 0 },
|
|
15620
15640
|
transition: { delay: 0.1 },
|
|
15621
15641
|
className: "space-y-6 lg:sticky lg:top-24 h-fit lg:col-span-1",
|
|
15622
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-linear-to-br from-
|
|
15642
|
+
children: /* @__PURE__ */ jsxRuntime.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: [
|
|
15623
15643
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6", children: "Order Summary" }),
|
|
15624
15644
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 mb-6", children: [
|
|
15625
15645
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -15647,7 +15667,7 @@ function CartScreen() {
|
|
|
15647
15667
|
{
|
|
15648
15668
|
type: "submit",
|
|
15649
15669
|
onClick: handleSubmit,
|
|
15650
|
-
className: "w-full rounded-full border-2 border-
|
|
15670
|
+
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",
|
|
15651
15671
|
children: [
|
|
15652
15672
|
"Proceed to Checkout",
|
|
15653
15673
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "h-5 w-5" })
|
|
@@ -16957,8 +16977,8 @@ function CheckoutScreen() {
|
|
|
16957
16977
|
animate: { opacity: 1, y: 0 },
|
|
16958
16978
|
transition: { duration: 0.5, ease: "easeOut", delay: 0.1 },
|
|
16959
16979
|
className: "space-y-10 lg:sticky lg:top-24 lg:col-span-1",
|
|
16960
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-linear-to-br from-
|
|
16961
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-
|
|
16980
|
+
children: /* @__PURE__ */ jsxRuntime.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: [
|
|
16981
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-secondary mb-6 text-2xl", children: "Order Summary" }),
|
|
16962
16982
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "mt-8 pt-6 border-t border-slate-100", children: [
|
|
16963
16983
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 mb-6", children: cart?.cartBody?.items?.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
|
|
16964
16984
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 rounded-xl overflow-hidden bg-white shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Image4__default.default, { src: item.productVariantData?.media?.[0]?.file || PLACEHOLDER_IMAGE_SRC, alt: item.productVariantData.name, className: "w-full h-full object-cover", height: 200, width: 200 }) }),
|
|
@@ -16969,10 +16989,10 @@ function CheckoutScreen() {
|
|
|
16969
16989
|
" \u2022 Qty: ",
|
|
16970
16990
|
item.quantity
|
|
16971
16991
|
] }),
|
|
16972
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-
|
|
16992
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-['Poppins',sans-serif] font-semibold text-[12px] text-secondary mt-1", children: formatPrice(item.productVariantData.finalPrice * item.quantity) })
|
|
16973
16993
|
] })
|
|
16974
16994
|
] }, item.productVariantId || item.id)) }),
|
|
16975
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-
|
|
16995
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-secondary/20 my-4" }),
|
|
16976
16996
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16977
16997
|
CouponCodeInput,
|
|
16978
16998
|
{
|
|
@@ -17004,14 +17024,14 @@ function CheckoutScreen() {
|
|
|
17004
17024
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Estimated tax" }),
|
|
17005
17025
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: formatPrice(tax) })
|
|
17006
17026
|
] }),
|
|
17007
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-
|
|
17027
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-secondary/20 mt-6" }),
|
|
17008
17028
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
17009
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-['Poppins',sans-serif] font-semibold text-[16px] text-
|
|
17010
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-['Poppins',sans-serif] font-bold text-[24px] text-
|
|
17029
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-['Poppins',sans-serif] font-semibold text-[16px] text-secondary", children: "Total" }),
|
|
17030
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-['Poppins',sans-serif] font-bold text-[24px] text-secondary", children: formatPrice(total) })
|
|
17011
17031
|
] })
|
|
17012
17032
|
] }),
|
|
17013
17033
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white/80 rounded-xl p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "font-['Poppins',sans-serif] text-[11px] text-[#676c80] leading-[1.6]", children: [
|
|
17014
|
-
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-
|
|
17034
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-secondary", children: "Payment:" }),
|
|
17015
17035
|
" We'll contact you to arrange payment upon pickup or delivery. We accept cash, credit cards, and all major payment methods."
|
|
17016
17036
|
] }) })
|
|
17017
17037
|
] }),
|
|
@@ -17047,7 +17067,7 @@ function CheckoutScreen() {
|
|
|
17047
17067
|
{
|
|
17048
17068
|
type: "submit",
|
|
17049
17069
|
disabled: isSubmitting,
|
|
17050
|
-
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-
|
|
17070
|
+
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",
|
|
17051
17071
|
children: [
|
|
17052
17072
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "h-5 w-5" }),
|
|
17053
17073
|
isSubmitting ? "Placing order..." : "Place Secure Order"
|
|
@@ -17152,14 +17172,11 @@ function LoginScreen() {
|
|
|
17152
17172
|
boxShadow: "0px 4px 6px -4px #0000001A, 0px 10px 15px -3px #0000001A"
|
|
17153
17173
|
},
|
|
17154
17174
|
children: [
|
|
17155
|
-
status && /* @__PURE__ */ jsxRuntime.
|
|
17175
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17156
17176
|
"div",
|
|
17157
17177
|
{
|
|
17158
17178
|
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"}`,
|
|
17159
|
-
children:
|
|
17160
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: " text-base", children: status.type === "success" ? "\u2714" : "!" }),
|
|
17161
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: status.message })
|
|
17162
|
-
]
|
|
17179
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: status.message })
|
|
17163
17180
|
}
|
|
17164
17181
|
),
|
|
17165
17182
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-start text-secondary", children: [
|
|
@@ -17202,26 +17219,14 @@ function LoginScreen() {
|
|
|
17202
17219
|
}
|
|
17203
17220
|
)
|
|
17204
17221
|
] }),
|
|
17205
|
-
/* @__PURE__ */ jsxRuntime.
|
|
17206
|
-
|
|
17207
|
-
|
|
17208
|
-
|
|
17209
|
-
|
|
17210
|
-
|
|
17211
|
-
|
|
17212
|
-
|
|
17213
|
-
),
|
|
17214
|
-
"Remember me"
|
|
17215
|
-
] }),
|
|
17216
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17217
|
-
Link9__default.default,
|
|
17218
|
-
{
|
|
17219
|
-
href: buildPath("/forgot-password"),
|
|
17220
|
-
className: "font-medium text-primary transition hover:opacity-80",
|
|
17221
|
-
children: "Forgot password?"
|
|
17222
|
-
}
|
|
17223
|
-
)
|
|
17224
|
-
] }),
|
|
17222
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17223
|
+
Link9__default.default,
|
|
17224
|
+
{
|
|
17225
|
+
href: buildPath("/forgot-password"),
|
|
17226
|
+
className: "font-medium text-primary transition hover:opacity-80",
|
|
17227
|
+
children: "Forgot password?"
|
|
17228
|
+
}
|
|
17229
|
+
) }),
|
|
17225
17230
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17226
17231
|
"button",
|
|
17227
17232
|
{
|
|
@@ -17992,7 +17997,7 @@ function AccountOverviewTab() {
|
|
|
17992
17997
|
] }),
|
|
17993
17998
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
17994
17999
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
17995
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "h-5 w-5 text-
|
|
18000
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "h-5 w-5 text-secondary" }) }),
|
|
17996
18001
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
17997
18002
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: "Full Name" }),
|
|
17998
18003
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-medium text-secondary", children: [
|
|
@@ -18003,21 +18008,21 @@ function AccountOverviewTab() {
|
|
|
18003
18008
|
] })
|
|
18004
18009
|
] }),
|
|
18005
18010
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
18006
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "h-5 w-5 text-
|
|
18011
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "h-5 w-5 text-secondary" }) }),
|
|
18007
18012
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
18008
18013
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: "E-mail Address" }),
|
|
18009
18014
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-secondary", children: user.email })
|
|
18010
18015
|
] })
|
|
18011
18016
|
] }),
|
|
18012
18017
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
18013
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "h-5 w-5 text-
|
|
18018
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "h-5 w-5 text-secondary" }) }),
|
|
18014
18019
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
18015
18020
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: "Phone Number" }),
|
|
18016
18021
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-secondary", children: user.phoneNumber || "Not provided" })
|
|
18017
18022
|
] })
|
|
18018
18023
|
] }),
|
|
18019
18024
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
18020
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MapPin, { className: "h-5 w-5 text-
|
|
18025
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-[#DBEAFE]", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MapPin, { className: "h-5 w-5 text-secondary" }) }),
|
|
18021
18026
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
18022
18027
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted", children: "Date of Birth" }),
|
|
18023
18028
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-secondary", children: "Not provided" })
|
|
@@ -18049,7 +18054,8 @@ function AccountOverviewTab() {
|
|
|
18049
18054
|
)) }) : recentOrders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted text-center py-8", children: "No orders yet" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: recentOrders.map((order) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18050
18055
|
"div",
|
|
18051
18056
|
{
|
|
18052
|
-
|
|
18057
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18058
|
+
className: "flex items-center justify-between rounded-lg bg-slate-50 p-4 hover:bg-slate-100 transition-colors cursor-pointer",
|
|
18053
18059
|
children: [
|
|
18054
18060
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
18055
18061
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-white", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Package, { className: "h-5 w-5 text-slate-600" }) }),
|
|
@@ -18081,6 +18087,8 @@ function AccountOverviewTab() {
|
|
|
18081
18087
|
}
|
|
18082
18088
|
function AccountOrdersTab() {
|
|
18083
18089
|
const { orders, isLoading, error } = useCurrentOrders();
|
|
18090
|
+
const router = navigation.useRouter();
|
|
18091
|
+
const { buildPath } = useBasePath();
|
|
18084
18092
|
if (isLoading) {
|
|
18085
18093
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-6 px-3 pb-24", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
18086
18094
|
"div",
|
|
@@ -18108,7 +18116,8 @@ function AccountOrdersTab() {
|
|
|
18108
18116
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18109
18117
|
"div",
|
|
18110
18118
|
{
|
|
18111
|
-
|
|
18119
|
+
onClick: () => router.push(buildPath(`/account/orders/${order._id}`)),
|
|
18120
|
+
className: "rounded-xl border border-slate-200 bg-white p-6 hover:shadow-md transition-shadow cursor-pointer",
|
|
18112
18121
|
children: [
|
|
18113
18122
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-4 pb-4 border-b border-slate-200", children: [
|
|
18114
18123
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -18548,7 +18557,7 @@ function AccountReviewsTab() {
|
|
|
18548
18557
|
"button",
|
|
18549
18558
|
{
|
|
18550
18559
|
onClick: () => router.push(buildPath("/reviews")),
|
|
18551
|
-
className: "inline-flex items-center gap-2 px-4 py-2 border border-
|
|
18560
|
+
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",
|
|
18552
18561
|
children: [
|
|
18553
18562
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4" }),
|
|
18554
18563
|
"Write a Review"
|
|
@@ -19923,7 +19932,7 @@ function WishlistScreen() {
|
|
|
19923
19932
|
{
|
|
19924
19933
|
type: "button",
|
|
19925
19934
|
onClick: () => router.push(buildPath("/shop")),
|
|
19926
|
-
className: "rounded-xl border-2 border-
|
|
19935
|
+
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",
|
|
19927
19936
|
children: "Discover products"
|
|
19928
19937
|
}
|
|
19929
19938
|
) })
|
|
@@ -21314,6 +21323,23 @@ function OrderDetailScreen({ id }) {
|
|
|
21314
21323
|
const router = navigation.useRouter();
|
|
21315
21324
|
const { buildPath } = useBasePath();
|
|
21316
21325
|
const { order, isLoading, error } = useOrder(id);
|
|
21326
|
+
const [storeAddress, setStoreAddress] = React10.useState(null);
|
|
21327
|
+
React10.useEffect(() => {
|
|
21328
|
+
if (order && order.orderType !== "Delivery" && !order.pickUpAddress) {
|
|
21329
|
+
const fetchStoreAddress = async () => {
|
|
21330
|
+
try {
|
|
21331
|
+
const api = new ShippingApi(AXIOS_CONFIG);
|
|
21332
|
+
const res = await api.getStoreAddress();
|
|
21333
|
+
if (res.data) {
|
|
21334
|
+
setStoreAddress(res.data);
|
|
21335
|
+
}
|
|
21336
|
+
} catch (e) {
|
|
21337
|
+
console.error("Failed to fetch store address:", e);
|
|
21338
|
+
}
|
|
21339
|
+
};
|
|
21340
|
+
fetchStoreAddress();
|
|
21341
|
+
}
|
|
21342
|
+
}, [order]);
|
|
21317
21343
|
if (isLoading) {
|
|
21318
21344
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-screen bg-slate-50 flex flex-col items-center justify-center p-4", children: [
|
|
21319
21345
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 border-4 border-primary-20 border-t-primary rounded-full animate-spin mb-4" }),
|
|
@@ -21348,7 +21374,7 @@ function OrderDetailScreen({ id }) {
|
|
|
21348
21374
|
}
|
|
21349
21375
|
};
|
|
21350
21376
|
const shippingAddress = order.shippingInfo?.addressTo;
|
|
21351
|
-
const pickupAddress = order.pickUpAddress;
|
|
21377
|
+
const pickupAddress = order.pickUpAddress || storeAddress;
|
|
21352
21378
|
const activeAddress = isDelivery ? shippingAddress : pickupAddress;
|
|
21353
21379
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-screen bg-linear-to-b from-[#F8FAFC] to-[#EBF4FB] pb-20", children: [
|
|
21354
21380
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto px-4 pt-8 max-w-6xl", children: [
|