subos-frontend 1.0.106 → 1.0.109
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/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types/App.d.ts.map +1 -1
- package/dist/types/components/icons/CommonIcons.d.ts +1 -0
- package/dist/types/components/icons/CommonIcons.d.ts.map +1 -1
- package/dist/types/components/subscription/ScheduledPlanNotification.d.ts +0 -1
- package/dist/types/components/subscription/ScheduledPlanNotification.d.ts.map +1 -1
- package/dist/types/context/SubscriptionContext.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -414,12 +414,14 @@ var SubscriptionProvider = ({ children }) => {
|
|
|
414
414
|
const [subscription, setSubscription] = React11.useState(null);
|
|
415
415
|
const [loading, setLoading] = React11.useState(false);
|
|
416
416
|
const [error, setError] = React11.useState(null);
|
|
417
|
+
const loadingRef = React11.useRef(false);
|
|
417
418
|
const fetchSubscription = React11.useCallback(async (externalId) => {
|
|
418
419
|
if (!externalId || externalId === "undefined" || externalId.trim() === "") {
|
|
419
420
|
setError("Invalid user ID. Please ensure you are properly authenticated.");
|
|
420
421
|
return;
|
|
421
422
|
}
|
|
422
|
-
if (
|
|
423
|
+
if (loadingRef.current) return;
|
|
424
|
+
loadingRef.current = true;
|
|
423
425
|
setLoading(true);
|
|
424
426
|
setError(null);
|
|
425
427
|
try {
|
|
@@ -435,9 +437,10 @@ var SubscriptionProvider = ({ children }) => {
|
|
|
435
437
|
setError("Failed to load subscription information. Please try again later.");
|
|
436
438
|
}
|
|
437
439
|
} finally {
|
|
440
|
+
loadingRef.current = false;
|
|
438
441
|
setLoading(false);
|
|
439
442
|
}
|
|
440
|
-
}, [
|
|
443
|
+
}, [currency]);
|
|
441
444
|
const clearSubscription = React11.useCallback(() => {
|
|
442
445
|
setSubscription(null);
|
|
443
446
|
setError(null);
|
|
@@ -1496,6 +1499,7 @@ var StarBorderIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.j
|
|
|
1496
1499
|
var UpgradeIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) });
|
|
1497
1500
|
var CancelIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
1498
1501
|
var AddCardIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6m12-3h3a3 3 0 013 3v8a3 3 0 01-3 3H6a3 3 0 01-3-3v-8a3 3 0 013-3h3" }) });
|
|
1502
|
+
var WarningIcon = ({ className = "w-5 h-5" }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) });
|
|
1499
1503
|
var PlansGrid = ({
|
|
1500
1504
|
plans,
|
|
1501
1505
|
selectedPlan,
|
|
@@ -3029,7 +3033,7 @@ var ScheduledPlanNotification = ({
|
|
|
3029
3033
|
return null;
|
|
3030
3034
|
}
|
|
3031
3035
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md flex items-start gap-3 ${className}`, children: [
|
|
3032
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-yellow-600 mt-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3036
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-yellow-600 mt-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(WarningIcon, { className: "w-5 h-5" }) }),
|
|
3033
3037
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-yellow-800", children: [
|
|
3034
3038
|
"Your subscription will change to ",
|
|
3035
3039
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: subscription.nextMembership.plan.name }),
|
|
@@ -3727,7 +3731,7 @@ var AppContent = ({ externalId }) => {
|
|
|
3727
3731
|
};
|
|
3728
3732
|
var App = function App2({ externalId, initialPage }) {
|
|
3729
3733
|
const detectedPage = initialPage || getInitialPageFromURL();
|
|
3730
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CurrencyProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(NavigationProvider, { initialPage: detectedPage, children: /* @__PURE__ */ jsxRuntime.jsx(AppContent, { externalId }) }) });
|
|
3734
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CurrencyProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SubscriptionProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(NavigationProvider, { initialPage: detectedPage, children: /* @__PURE__ */ jsxRuntime.jsx(AppContent, { externalId }) }) }) });
|
|
3731
3735
|
};
|
|
3732
3736
|
|
|
3733
3737
|
exports.AddCardIcon = AddCardIcon;
|
|
@@ -3785,6 +3789,7 @@ exports.TrendingUpIcon = TrendingUpIcon;
|
|
|
3785
3789
|
exports.UpgradeIcon = UpgradeIcon;
|
|
3786
3790
|
exports.UpgradeProvider = UpgradeProvider;
|
|
3787
3791
|
exports.UpgradeSummary = UpgradeSummary;
|
|
3792
|
+
exports.WarningIcon = WarningIcon;
|
|
3788
3793
|
exports.clearSelectedPlan = clearSelectedPlan;
|
|
3789
3794
|
exports.configureSubOS = configureSubOS;
|
|
3790
3795
|
exports.customerApi = customerApi;
|