@fluid-app/portal-sdk 0.1.83 → 0.1.85
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/dist/{AppNavigationContext-Du3Qq0yc.mjs → AppNavigationContext-BSnbFILQ.mjs} +1 -1
- package/dist/{AppNavigationContext-Du3Qq0yc.mjs.map → AppNavigationContext-BSnbFILQ.mjs.map} +1 -1
- package/dist/{AppNavigationContext-Agp0UkCQ.cjs → AppNavigationContext-DnwdUAjn.cjs} +1 -1
- package/dist/{AppNavigationContext-Agp0UkCQ.cjs.map → AppNavigationContext-DnwdUAjn.cjs.map} +1 -1
- package/dist/{ContactsScreen-FJUtn2_G.mjs → ContactsScreen-DrkHWPMm.mjs} +4 -4
- package/dist/{ContactsScreen-FJUtn2_G.mjs.map → ContactsScreen-DrkHWPMm.mjs.map} +1 -1
- package/dist/{ContactsScreen-aPH9Xaim.cjs → ContactsScreen-Du9M90zi.cjs} +5 -5
- package/dist/{ContactsScreen-6gXKTN61.cjs → ContactsScreen-DvmqkXOu.cjs} +4 -4
- package/dist/{ContactsScreen-6gXKTN61.cjs.map → ContactsScreen-DvmqkXOu.cjs.map} +1 -1
- package/dist/{CustomersScreen-9f10-_AZ.cjs → CustomersScreen-Bd9eK18y.cjs} +1 -1
- package/dist/{CustomersScreen-9f10-_AZ.cjs.map → CustomersScreen-Bd9eK18y.cjs.map} +1 -1
- package/dist/{CustomersScreen-xAauAB-B.mjs → CustomersScreen-DEFY3mRL.mjs} +1 -1
- package/dist/{CustomersScreen-xAauAB-B.mjs.map → CustomersScreen-DEFY3mRL.mjs.map} +1 -1
- package/dist/{MessagingScreen-CWJA4usG.cjs → MessagingScreen-BlN6KjV-.cjs} +3 -3
- package/dist/{MessagingScreen-DWNe8VFM.mjs → MessagingScreen-C4-8_bvB.mjs} +3 -3
- package/dist/{MessagingScreen-7_YhiLVY.mjs → MessagingScreen-Cg2XvQZF.mjs} +3 -3
- package/dist/{MessagingScreen-7_YhiLVY.mjs.map → MessagingScreen-Cg2XvQZF.mjs.map} +1 -1
- package/dist/{MessagingScreen-B_5Ci5s-.cjs → MessagingScreen-Lc81OXIN.cjs} +3 -3
- package/dist/{MessagingScreen-B_5Ci5s-.cjs.map → MessagingScreen-Lc81OXIN.cjs.map} +1 -1
- package/dist/{MySiteScreen-CtVL7wfc.cjs → MySiteScreen-B-I4V3Cc.cjs} +2 -2
- package/dist/{MySiteScreen-CtVL7wfc.cjs.map → MySiteScreen-B-I4V3Cc.cjs.map} +1 -1
- package/dist/{MySiteScreen-Cspeq0cy.mjs → MySiteScreen-BedF13nt.mjs} +2 -2
- package/dist/{MySiteScreen-Cspeq0cy.mjs.map → MySiteScreen-BedF13nt.mjs.map} +1 -1
- package/dist/{MySiteScreen-D5tr7TdT.cjs → MySiteScreen-DEOKI32H.cjs} +1 -1
- package/dist/{OrdersScreen-DiKPQvwJ.cjs → OrdersScreen-BE_E1QGL.cjs} +2 -2
- package/dist/{OrdersScreen-Bu82RCok.cjs → OrdersScreen-C-rU9cx6.cjs} +4 -4
- package/dist/{OrdersScreen-Bu82RCok.cjs.map → OrdersScreen-C-rU9cx6.cjs.map} +1 -1
- package/dist/{OrdersScreen-DrCPl7uv.mjs → OrdersScreen-CfAmUUN3.mjs} +4 -4
- package/dist/{OrdersScreen-DrCPl7uv.mjs.map → OrdersScreen-CfAmUUN3.mjs.map} +1 -1
- package/dist/{ProductsScreen-BHHo6Wen.mjs → ProductsScreen-CGo9KQ9L.mjs} +3 -3
- package/dist/{ProductsScreen-BHHo6Wen.mjs.map → ProductsScreen-CGo9KQ9L.mjs.map} +1 -1
- package/dist/{ProductsScreen-CoyGeILD.mjs → ProductsScreen-CgG79XW9.mjs} +5 -5
- package/dist/{ProductsScreen-Doc9tmAQ.cjs → ProductsScreen-Csw96ete.cjs} +3 -3
- package/dist/{ProductsScreen-Doc9tmAQ.cjs.map → ProductsScreen-Csw96ete.cjs.map} +1 -1
- package/dist/{ProductsScreen-CCNyLHqR.cjs → ProductsScreen-DUPhUJ7p.cjs} +5 -5
- package/dist/{ShareablesScreen-CNMWSoKY.mjs → ShareablesScreen-BK0H5fb2.mjs} +30 -9
- package/dist/ShareablesScreen-BK0H5fb2.mjs.map +1 -0
- package/dist/{ShareablesScreen-BRxLz3zn.mjs → ShareablesScreen-BmKYYRZq.mjs} +5 -5
- package/dist/{ShareablesScreen-Dp3BcjuA.cjs → ShareablesScreen-D0kIiW8S.cjs} +34 -7
- package/dist/ShareablesScreen-D0kIiW8S.cjs.map +1 -0
- package/dist/{ShareablesScreen-C5GJg1EP.cjs → ShareablesScreen-loETsu9v.cjs} +5 -5
- package/dist/{ShopScreen-nJhut901.cjs → ShopScreen-BK6QNd3h.cjs} +1 -1
- package/dist/{ShopScreen-CPWZhKgE.cjs → ShopScreen-D2S24-LK.cjs} +92 -73
- package/dist/ShopScreen-D2S24-LK.cjs.map +1 -0
- package/dist/{ShopScreen-CVxmqfmN.mjs → ShopScreen-DdPigYbj.mjs} +93 -74
- package/dist/{ShopScreen-CVxmqfmN.mjs.map → ShopScreen-DdPigYbj.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CSKVsakI.cjs → SubscriptionsScreen-CfvaEuTS.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CSKVsakI.cjs.map → SubscriptionsScreen-CfvaEuTS.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CJdcyH-e.mjs → SubscriptionsScreen-D3LAx25s.mjs} +4 -4
- package/dist/{SubscriptionsScreen-CJdcyH-e.mjs.map → SubscriptionsScreen-D3LAx25s.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-C1UWxvQk.cjs → SubscriptionsScreen-Dpn0YuDb.cjs} +3 -3
- package/dist/{dist-B4Ke7bHH.cjs → dist-BK4mvUPm.cjs} +2 -2
- package/dist/{dist-B4Ke7bHH.cjs.map → dist-BK4mvUPm.cjs.map} +1 -1
- package/dist/{dist-Cl4FsM3V.mjs → dist-C9vpl_rR.mjs} +2 -2
- package/dist/{dist-Cl4FsM3V.mjs.map → dist-C9vpl_rR.mjs.map} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs → dist-CkIGP8my.mjs} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs.map → dist-CkIGP8my.mjs.map} +1 -1
- package/dist/{dist-BbS_7TvS.cjs → dist-thaj08s5.cjs} +1 -1
- package/dist/{dist-BbS_7TvS.cjs.map → dist-thaj08s5.cjs.map} +1 -1
- package/dist/{es-1KItbbYg.mjs → es-Dlib2eNY.mjs} +1 -1
- package/dist/{es-1KItbbYg.mjs.map → es-Dlib2eNY.mjs.map} +1 -1
- package/dist/{es-BSkb3AZk.cjs → es-xQF-WIMq.cjs} +1 -1
- package/dist/{es-BSkb3AZk.cjs.map → es-xQF-WIMq.cjs.map} +1 -1
- package/dist/index.cjs +140 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +22 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +137 -44
- package/dist/index.mjs.map +1 -1
- package/dist/{order-detail-Cj68hbgK.cjs → order-detail-06VbWJjw.cjs} +1 -1
- package/dist/{order-detail-Cj68hbgK.cjs.map → order-detail-06VbWJjw.cjs.map} +1 -1
- package/dist/{order-detail-B-4hsupW.mjs → order-detail-B5X_QRpi.mjs} +1 -1
- package/dist/{order-detail-B-4hsupW.mjs.map → order-detail-B5X_QRpi.mjs.map} +1 -1
- package/dist/{products-BKZ1siXg.cjs → products-CjZof7c2.cjs} +1 -1
- package/dist/{products-BKZ1siXg.cjs.map → products-CjZof7c2.cjs.map} +1 -1
- package/dist/{products-DOO1TBcm.mjs → products-Dkwd_Bh0.mjs} +1 -1
- package/dist/{products-DOO1TBcm.mjs.map → products-Dkwd_Bh0.mjs.map} +1 -1
- package/dist/{src-nhqydD53.mjs → src-BjmyVJoe.mjs} +21 -20
- package/dist/src-BjmyVJoe.mjs.map +1 -0
- package/dist/{src-Dzexc0vw.cjs → src-Dt66UB0B.cjs} +1 -1
- package/dist/{src-Dzexc0vw.cjs.map → src-Dt66UB0B.cjs.map} +1 -1
- package/dist/{src-fXyI4AWk.cjs → src-bzRRiTN4.cjs} +21 -20
- package/dist/src-bzRRiTN4.cjs.map +1 -0
- package/dist/{src-DfVbSKm5.mjs → src-p8DA1dH0.mjs} +1 -1
- package/dist/{src-DfVbSKm5.mjs.map → src-p8DA1dH0.mjs.map} +1 -1
- package/dist/{use-customer-account-Dysq4hpT.cjs → use-customer-account-BoobPvSQ.cjs} +1 -1
- package/dist/{use-customer-account-Dysq4hpT.cjs.map → use-customer-account-BoobPvSQ.cjs.map} +1 -1
- package/dist/{use-customer-account-B0DeL6m0.mjs → use-customer-account-Dt3kO7ti.mjs} +1 -1
- package/dist/{use-customer-account-B0DeL6m0.mjs.map → use-customer-account-Dt3kO7ti.mjs.map} +1 -1
- package/package.json +12 -12
- package/dist/ShareablesScreen-CNMWSoKY.mjs.map +0 -1
- package/dist/ShareablesScreen-Dp3BcjuA.cjs.map +0 -1
- package/dist/ShopScreen-CPWZhKgE.cjs.map +0 -1
- package/dist/src-fXyI4AWk.cjs.map +0 -1
- package/dist/src-nhqydD53.mjs.map +0 -1
- /package/dist/{ProfileScreen-BKKIMZiD.cjs → ProfileScreen-BSZLS9hY.cjs} +0 -0
- /package/dist/{src-BakNjVTk.mjs → src-B7j_mfeS.mjs} +0 -0
- /package/dist/{src-C_kOrGdZ.cjs → src-Bp-dRR29.cjs} +0 -0
|
@@ -4,12 +4,12 @@ import { A as SelectContent, F as RadioGroupItem, I as Input, Kt as Breadcrumb,
|
|
|
4
4
|
import { i as useSdkClient, o as useFluidAuth } from "./use-account-clients-Cf_6sxeC.mjs";
|
|
5
5
|
import { n as useScreenHeaderActions, r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-NdrJ58Mg.mjs";
|
|
6
6
|
import { n as useCurrentUser } from "./use-current-user-Bl9nPNFt.mjs";
|
|
7
|
-
import { n as useAppNavigation } from "./AppNavigationContext-
|
|
8
|
-
import { n as listProducts, t as getProduct } from "./products-
|
|
7
|
+
import { n as useAppNavigation } from "./AppNavigationContext-BSnbFILQ.mjs";
|
|
8
|
+
import { n as listProducts, t as getProduct } from "./products-Dkwd_Bh0.mjs";
|
|
9
9
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { ArrowLeft, ChevronLeft, ChevronRight, CirclePlay, Search, ShoppingCart } from "lucide-react";
|
|
12
|
+
import { ArrowLeft, ChevronLeft, ChevronRight, CirclePlay, Link, Search, ShoppingCart } from "lucide-react";
|
|
13
13
|
import { createPortal } from "react-dom";
|
|
14
14
|
import { create } from "zustand";
|
|
15
15
|
import "zustand/middleware";
|
|
@@ -1345,7 +1345,7 @@ function ProductListing({ countryCode, companyLogoUrl, renderImage, onSelectProd
|
|
|
1345
1345
|
})]
|
|
1346
1346
|
});
|
|
1347
1347
|
}
|
|
1348
|
-
function ProductDetail({ productId, countryCode, renderImage, onBack, onAddToCart, cartButton }) {
|
|
1348
|
+
function ProductDetail({ productId, countryCode, renderImage, onBack, onAddToCart, cartButton, companyName }) {
|
|
1349
1349
|
const { product, isLoading, error, currentVariant, productOptions, effectiveSelectedOptions, handleOptionChange, quantity, setQuantity, isSubscribe, userSelectedSubscribe, setUserSelectedSubscribe, showBuyOnce, showSubscribe, selectedSubscriptionPlan, setSelectedSubscriptionPlan, displayPrice, displayWholesalePrice, displayWholesaleSubscriptionPrice, wholesaleCv, wholesaleQv, currentVariantCountry } = useProductDetail({
|
|
1350
1350
|
productId,
|
|
1351
1351
|
countryCode
|
|
@@ -1361,6 +1361,8 @@ function ProductDetail({ productId, countryCode, renderImage, onBack, onAddToCar
|
|
|
1361
1361
|
currentVariant?.images,
|
|
1362
1362
|
coverImage
|
|
1363
1363
|
]);
|
|
1364
|
+
const isBundle = product?.bundle === true;
|
|
1365
|
+
const bundleUrl = isBundle && product?.canonical_url ? product.canonical_url : null;
|
|
1364
1366
|
const handleAddToCart = () => {
|
|
1365
1367
|
if (!onAddToCart || !currentVariant?.id) return;
|
|
1366
1368
|
onAddToCart(currentVariant.id, quantity, isSubscribe, selectedSubscriptionPlan?.subscription_plan?.id?.toString());
|
|
@@ -1435,7 +1437,7 @@ function ProductDetail({ productId, countryCode, renderImage, onBack, onAddToCar
|
|
|
1435
1437
|
className: "text-foreground text-3xl font-bold",
|
|
1436
1438
|
children: title
|
|
1437
1439
|
}),
|
|
1438
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1440
|
+
!isBundle && /* @__PURE__ */ jsxs("div", {
|
|
1439
1441
|
className: "mb-2 flex items-center gap-2",
|
|
1440
1442
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1441
1443
|
className: "text-foreground text-sm",
|
|
@@ -1455,81 +1457,96 @@ function ProductDetail({ productId, countryCode, renderImage, onBack, onAddToCar
|
|
|
1455
1457
|
dangerouslySetInnerHTML: { __html: sanitizeHtml(product.description ?? "") }
|
|
1456
1458
|
})]
|
|
1457
1459
|
}),
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
isSubscribe,
|
|
1462
|
-
userSelectedSubscribe,
|
|
1463
|
-
onSubscribeChange: setUserSelectedSubscribe,
|
|
1464
|
-
wholesalePrice: currentVariantCountry?.wholesale,
|
|
1465
|
-
wholesaleSubscriptionPrice: currentVariantCountry?.wholesale_subscription_price,
|
|
1466
|
-
product_subscription_plans: product.product_subscription_plans || [],
|
|
1467
|
-
selectedSubscriptionPlan,
|
|
1468
|
-
onSubscriptionPlanChange: setSelectedSubscriptionPlan
|
|
1469
|
-
}),
|
|
1470
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1471
|
-
className: "text-muted-foreground mb-3 text-sm",
|
|
1472
|
-
children: [
|
|
1473
|
-
"CV ",
|
|
1474
|
-
countryCode && wholesaleCv != null ? wholesaleCv : "-",
|
|
1475
|
-
" | QV",
|
|
1476
|
-
" ",
|
|
1477
|
-
countryCode && wholesaleQv != null ? wholesaleQv : "-"
|
|
1478
|
-
]
|
|
1479
|
-
}),
|
|
1480
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center border-t" }),
|
|
1481
|
-
productOptions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
1482
|
-
className: "mb-4 pt-4",
|
|
1483
|
-
children: productOptions.map((option) => /* @__PURE__ */ jsxs("div", {
|
|
1484
|
-
className: "mb-3 flex items-center",
|
|
1485
|
-
children: [/* @__PURE__ */ jsx("h3", {
|
|
1486
|
-
className: "text-md text-foreground w-24 font-bold",
|
|
1487
|
-
children: option.name.charAt(0).toUpperCase() + option.name.slice(1)
|
|
1488
|
-
}), /* @__PURE__ */ jsxs(Select, {
|
|
1489
|
-
value: effectiveSelectedOptions[option.id] || "",
|
|
1490
|
-
onValueChange: (value) => handleOptionChange(option.id, value),
|
|
1491
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
1492
|
-
className: "w-48 max-w-full",
|
|
1493
|
-
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `Select ${option.name}` })
|
|
1494
|
-
}), /* @__PURE__ */ jsx(SelectContent, { children: option.values.map((value) => /* @__PURE__ */ jsx(SelectItem, {
|
|
1495
|
-
value,
|
|
1496
|
-
children: value
|
|
1497
|
-
}, value)) })]
|
|
1498
|
-
})]
|
|
1499
|
-
}, option.id))
|
|
1500
|
-
}),
|
|
1501
|
-
currentVariant?.subscription_only && !currentVariant.allow_subscription && /* @__PURE__ */ jsx("div", {
|
|
1502
|
-
className: "text-muted-foreground text-sm",
|
|
1503
|
-
children: "This product is unavailable for purchase."
|
|
1504
|
-
}),
|
|
1505
|
-
/* @__PURE__ */ jsx("div", { className: "mb-3" }),
|
|
1506
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1507
|
-
className: "flex items-center gap-3 pb-3",
|
|
1508
|
-
children: [/* @__PURE__ */ jsx(QuantitySelector, {
|
|
1509
|
-
quantity,
|
|
1510
|
-
setQuantity
|
|
1511
|
-
}), /* @__PURE__ */ jsxs(Button, {
|
|
1512
|
-
disabled: !currentVariant?.id || currentVariant?.subscription_only && !currentVariant.allow_subscription,
|
|
1460
|
+
isBundle ? /* @__PURE__ */ jsxs("div", {
|
|
1461
|
+
className: "pt-4",
|
|
1462
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
1513
1463
|
variant: "default",
|
|
1514
|
-
className: "
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
"data-fluid-quantity": quantity,
|
|
1519
|
-
"data-fluid-subscribe": isSubscribe,
|
|
1520
|
-
"data-fluid-subscription-plan-id": isSubscribe ? selectedSubscriptionPlan?.subscription_plan?.id?.toString() || product.product_subscription_plans?.find((plan) => plan.default)?.subscription_plan.id.toString() || product.product_subscription_plans?.[0]?.subscription_plan.id.toString() || "" : "",
|
|
1521
|
-
"data-fluid-open-cart-after-add": "false"
|
|
1464
|
+
className: "w-full gap-2 py-2 text-base font-medium",
|
|
1465
|
+
disabled: !bundleUrl,
|
|
1466
|
+
onClick: () => {
|
|
1467
|
+
if (bundleUrl) window.open(bundleUrl, "_blank", "noopener,noreferrer");
|
|
1522
1468
|
},
|
|
1523
|
-
children: [/* @__PURE__ */ jsx(
|
|
1469
|
+
children: [/* @__PURE__ */ jsx(Link, { className: "h-5 w-5" }), companyName ? `Purchase at ${companyName}` : "Purchase Bundle"]
|
|
1470
|
+
}), !bundleUrl && /* @__PURE__ */ jsx("p", {
|
|
1471
|
+
className: "text-muted-foreground mt-2 text-center text-xs",
|
|
1472
|
+
children: "Bundle configuration is unavailable. Please contact support."
|
|
1524
1473
|
})]
|
|
1525
|
-
})
|
|
1474
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1475
|
+
/* @__PURE__ */ jsx(PurchaseOptions, {
|
|
1476
|
+
showBuyOnce,
|
|
1477
|
+
showSubscribe,
|
|
1478
|
+
isSubscribe,
|
|
1479
|
+
userSelectedSubscribe,
|
|
1480
|
+
onSubscribeChange: setUserSelectedSubscribe,
|
|
1481
|
+
wholesalePrice: currentVariantCountry?.wholesale,
|
|
1482
|
+
wholesaleSubscriptionPrice: currentVariantCountry?.wholesale_subscription_price,
|
|
1483
|
+
product_subscription_plans: product.product_subscription_plans || [],
|
|
1484
|
+
selectedSubscriptionPlan,
|
|
1485
|
+
onSubscriptionPlanChange: setSelectedSubscriptionPlan
|
|
1486
|
+
}),
|
|
1487
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1488
|
+
className: "text-muted-foreground mb-3 text-sm",
|
|
1489
|
+
children: [
|
|
1490
|
+
"CV ",
|
|
1491
|
+
countryCode && wholesaleCv != null ? wholesaleCv : "-",
|
|
1492
|
+
" | QV ",
|
|
1493
|
+
countryCode && wholesaleQv != null ? wholesaleQv : "-"
|
|
1494
|
+
]
|
|
1495
|
+
}),
|
|
1496
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center border-t" }),
|
|
1497
|
+
productOptions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
1498
|
+
className: "mb-4 pt-4",
|
|
1499
|
+
children: productOptions.map((option) => /* @__PURE__ */ jsxs("div", {
|
|
1500
|
+
className: "mb-3 flex items-center",
|
|
1501
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
1502
|
+
className: "text-md text-foreground w-24 font-bold",
|
|
1503
|
+
children: option.name.charAt(0).toUpperCase() + option.name.slice(1)
|
|
1504
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
1505
|
+
value: effectiveSelectedOptions[option.id] || "",
|
|
1506
|
+
onValueChange: (value) => handleOptionChange(option.id, value),
|
|
1507
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
1508
|
+
className: "w-48 max-w-full",
|
|
1509
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `Select ${option.name}` })
|
|
1510
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: option.values.map((value) => /* @__PURE__ */ jsx(SelectItem, {
|
|
1511
|
+
value,
|
|
1512
|
+
children: value
|
|
1513
|
+
}, value)) })]
|
|
1514
|
+
})]
|
|
1515
|
+
}, option.id))
|
|
1516
|
+
}),
|
|
1517
|
+
currentVariant?.subscription_only && !currentVariant.allow_subscription && /* @__PURE__ */ jsx("div", {
|
|
1518
|
+
className: "text-muted-foreground text-sm",
|
|
1519
|
+
children: "This product is unavailable for purchase."
|
|
1520
|
+
}),
|
|
1521
|
+
/* @__PURE__ */ jsx("div", { className: "mb-3" }),
|
|
1522
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1523
|
+
className: "flex items-center gap-3 pb-3",
|
|
1524
|
+
children: [/* @__PURE__ */ jsx(QuantitySelector, {
|
|
1525
|
+
quantity,
|
|
1526
|
+
setQuantity
|
|
1527
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
1528
|
+
disabled: !currentVariant?.id || currentVariant?.subscription_only && !currentVariant.allow_subscription,
|
|
1529
|
+
variant: "default",
|
|
1530
|
+
className: "flex-1 gap-2 py-2 text-base font-medium",
|
|
1531
|
+
onClick: onAddToCart ? handleAddToCart : void 0,
|
|
1532
|
+
...!onAddToCart && {
|
|
1533
|
+
"data-fluid-add-to-cart": String(currentVariant?.id ?? ""),
|
|
1534
|
+
"data-fluid-quantity": quantity,
|
|
1535
|
+
"data-fluid-subscribe": isSubscribe,
|
|
1536
|
+
"data-fluid-subscription-plan-id": isSubscribe ? selectedSubscriptionPlan?.subscription_plan?.id?.toString() || product.product_subscription_plans?.find((plan) => plan.default)?.subscription_plan.id.toString() || product.product_subscription_plans?.[0]?.subscription_plan.id.toString() || "" : "",
|
|
1537
|
+
"data-fluid-open-cart-after-add": "false"
|
|
1538
|
+
},
|
|
1539
|
+
children: [/* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }), isSubscribe ? "Subscribe" : "Add to Cart"]
|
|
1540
|
+
})]
|
|
1541
|
+
})
|
|
1542
|
+
] })
|
|
1526
1543
|
]
|
|
1527
1544
|
})]
|
|
1528
1545
|
})
|
|
1529
1546
|
})]
|
|
1530
1547
|
});
|
|
1531
1548
|
}
|
|
1532
|
-
function ShopApp({ countryCode, companyLogoUrl, renderImage, onAddToCart, productId: controlledProductId, onSelectProduct: onSelectProductProp, onBack: onBackProp, cartButton }) {
|
|
1549
|
+
function ShopApp({ countryCode, companyLogoUrl, renderImage, onAddToCart, productId: controlledProductId, onSelectProduct: onSelectProductProp, onBack: onBackProp, cartButton, companyName }) {
|
|
1533
1550
|
const [internalProductId, setInternalProductId] = useState(null);
|
|
1534
1551
|
const activeProductId = controlledProductId !== void 0 ? controlledProductId : internalProductId;
|
|
1535
1552
|
const handleSelectProduct = onSelectProductProp ?? setInternalProductId;
|
|
@@ -1540,7 +1557,8 @@ function ShopApp({ countryCode, companyLogoUrl, renderImage, onAddToCart, produc
|
|
|
1540
1557
|
renderImage,
|
|
1541
1558
|
onBack: handleBack,
|
|
1542
1559
|
onAddToCart,
|
|
1543
|
-
cartButton
|
|
1560
|
+
cartButton,
|
|
1561
|
+
companyName
|
|
1544
1562
|
});
|
|
1545
1563
|
return /* @__PURE__ */ jsx(ProductListing, {
|
|
1546
1564
|
countryCode,
|
|
@@ -1742,7 +1760,8 @@ function ShopScreen({ background, textColor, accentColor, padding, borderRadius,
|
|
|
1742
1760
|
companyLogoUrl: userData?.company?.logo_url,
|
|
1743
1761
|
productId,
|
|
1744
1762
|
onSelectProduct: (id) => navigate(`shop/${id}`),
|
|
1745
|
-
onBack: () => navigate("shop")
|
|
1763
|
+
onBack: () => navigate("shop"),
|
|
1764
|
+
companyName: userData?.company?.name
|
|
1746
1765
|
})
|
|
1747
1766
|
})
|
|
1748
1767
|
})
|
|
@@ -1760,4 +1779,4 @@ const shopScreenPropertySchema = {
|
|
|
1760
1779
|
//#endregion
|
|
1761
1780
|
export { ShopScreen_exports as n, shopScreenPropertySchema as r, ShopScreen as t };
|
|
1762
1781
|
|
|
1763
|
-
//# sourceMappingURL=ShopScreen-
|
|
1782
|
+
//# sourceMappingURL=ShopScreen-DdPigYbj.mjs.map
|