@bunnyapp/components 1.6.0-beta.2 → 1.6.0-beta.3
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
CHANGED
|
@@ -54,6 +54,25 @@ npm run codegen
|
|
|
54
54
|
npx gql-tada doctor
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
### Deprecating @bunnyapp/common
|
|
58
|
+
|
|
59
|
+
We are gradually deprecating `@bunnyapp/common` and moving types and enums locally to this repository. When something is moved from `@bunnyapp/common`, follow this pattern:
|
|
60
|
+
|
|
61
|
+
1. **Create local definitions**:
|
|
62
|
+
- **Enums** → Create in `src/enums/` directory (e.g., `src/enums/SubscriptionState.ts`)
|
|
63
|
+
- **Types** → Create in `src/types/` directory (e.g., `src/types/billingDetails.ts`)
|
|
64
|
+
|
|
65
|
+
2. **Update imports incrementally**: Only update the files that need the change. Other files can continue importing from `@bunnyapp/common` until they need to be updated.
|
|
66
|
+
|
|
67
|
+
3. **Example pattern**:
|
|
68
|
+
```typescript
|
|
69
|
+
// Before (from @bunnyapp/common)
|
|
70
|
+
import { SubscriptionState } from '@bunnyapp/common';
|
|
71
|
+
|
|
72
|
+
// After (local enum)
|
|
73
|
+
import SubscriptionState from '../enums/SubscriptionState';
|
|
74
|
+
```
|
|
75
|
+
|
|
57
76
|
### Storybook stories
|
|
58
77
|
|
|
59
78
|
To view the storybook stories, run `npx storybook dev`.
|
package/dist/cjs/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var css_248z = ":root {\n --row-background: #ffffff;\n --row-background-altern
|
|
|
52
52
|
styleInject(css_248z);
|
|
53
53
|
|
|
54
54
|
// This will be replaced at build time by rollup-plugin-replace
|
|
55
|
-
const PACKAGE_VERSION = '1.6.0-beta.
|
|
55
|
+
const PACKAGE_VERSION = '1.6.0-beta.2';
|
|
56
56
|
const createRequestHeaders = (token) => {
|
|
57
57
|
const headers = createClientDevHeaders({ token });
|
|
58
58
|
// Add the components version header
|
|
@@ -22164,10 +22164,21 @@ const useHasTaxPlugin = ({ apiHost, token, }) => {
|
|
|
22164
22164
|
return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
|
|
22165
22165
|
};
|
|
22166
22166
|
|
|
22167
|
+
var SubscriptionState;
|
|
22168
|
+
(function (SubscriptionState) {
|
|
22169
|
+
SubscriptionState["ACTIVE"] = "ACTIVE";
|
|
22170
|
+
SubscriptionState["TRIAL"] = "TRIAL";
|
|
22171
|
+
SubscriptionState["PENDING"] = "PENDING";
|
|
22172
|
+
SubscriptionState["EXPIRED"] = "EXPIRED";
|
|
22173
|
+
SubscriptionState["CANCELED"] = "CANCELED";
|
|
22174
|
+
SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
|
|
22175
|
+
})(SubscriptionState || (SubscriptionState = {}));
|
|
22176
|
+
var SubscriptionState$1 = SubscriptionState;
|
|
22177
|
+
|
|
22167
22178
|
function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
|
|
22168
22179
|
var _a, _b;
|
|
22169
|
-
const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) ===
|
|
22170
|
-
((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) ===
|
|
22180
|
+
const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
|
|
22181
|
+
((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
|
|
22171
22182
|
function upgradingFromFree() {
|
|
22172
22183
|
const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
|
|
22173
22184
|
return totalPrice === 0;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useContext, useMemo, useState, useEffect, useRef, useCallback, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { DownloadOutlined, CreditCardOutlined, EllipsisOutlined, BankOutlined, SearchOutlined, CheckCircleFilled, CloseOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
4
|
-
import { gqlRequest as gqlRequest$1, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, QueryKeyFactory, useIsMobile, isColorTooDark, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, request as request$1, PRIMARY_COLOR, useErrorNotification, invokePlugin, useAllErrorFormats, formatCurrency, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, SLATE_500, Lists,
|
|
4
|
+
import { gqlRequest as gqlRequest$1, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, QueryKeyFactory, useIsMobile, isColorTooDark, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, request as request$1, PRIMARY_COLOR, useErrorNotification, invokePlugin, useAllErrorFormats, formatCurrency, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, SLATE_500, Lists, QuoteChangeKind, getAccount, BillingPeriod, MODAL_MAX_HEIGHT, DataInterval, SubscriptionState as SubscriptionState$2, PricingModel, ChargeType, StringUtils, PERIOD_LABELS, PricingStyle, SLATE_100 } from '@bunnyapp/common';
|
|
5
5
|
import { ConfigProvider, Spin, Button, theme as theme$1, Tag, Dropdown, Typography, Input, Modal, Checkbox, Skeleton, Collapse, Form, Tooltip, Drawer, Card as Card$1, Divider, Select, Image, Popconfirm, Table, Radio, Space, Switch } from 'antd';
|
|
6
6
|
import { Markup } from 'interweave';
|
|
7
7
|
import request, { GraphQLClient } from 'graphql-request';
|
|
@@ -50,7 +50,7 @@ var css_248z = ":root {\n --row-background: #ffffff;\n --row-background-altern
|
|
|
50
50
|
styleInject(css_248z);
|
|
51
51
|
|
|
52
52
|
// This will be replaced at build time by rollup-plugin-replace
|
|
53
|
-
const PACKAGE_VERSION = '1.6.0-beta.
|
|
53
|
+
const PACKAGE_VERSION = '1.6.0-beta.2';
|
|
54
54
|
const createRequestHeaders = (token) => {
|
|
55
55
|
const headers = createClientDevHeaders({ token });
|
|
56
56
|
// Add the components version header
|
|
@@ -22162,10 +22162,21 @@ const useHasTaxPlugin = ({ apiHost, token, }) => {
|
|
|
22162
22162
|
return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
|
|
22163
22163
|
};
|
|
22164
22164
|
|
|
22165
|
+
var SubscriptionState;
|
|
22166
|
+
(function (SubscriptionState) {
|
|
22167
|
+
SubscriptionState["ACTIVE"] = "ACTIVE";
|
|
22168
|
+
SubscriptionState["TRIAL"] = "TRIAL";
|
|
22169
|
+
SubscriptionState["PENDING"] = "PENDING";
|
|
22170
|
+
SubscriptionState["EXPIRED"] = "EXPIRED";
|
|
22171
|
+
SubscriptionState["CANCELED"] = "CANCELED";
|
|
22172
|
+
SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
|
|
22173
|
+
})(SubscriptionState || (SubscriptionState = {}));
|
|
22174
|
+
var SubscriptionState$1 = SubscriptionState;
|
|
22175
|
+
|
|
22165
22176
|
function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
|
|
22166
22177
|
var _a, _b;
|
|
22167
|
-
const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL ||
|
|
22168
|
-
((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED;
|
|
22178
|
+
const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
|
|
22179
|
+
((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
|
|
22169
22180
|
function upgradingFromFree() {
|
|
22170
22181
|
const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
|
|
22171
22182
|
return totalPrice === 0;
|
|
@@ -22856,29 +22867,29 @@ const TAG_COLORS = {
|
|
|
22856
22867
|
|
|
22857
22868
|
const canSubscriptionUpgradeFromTrial = (subscription) => {
|
|
22858
22869
|
var _a;
|
|
22859
|
-
return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL &&
|
|
22870
|
+
return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
|
|
22860
22871
|
subscription.plan.selfServiceBuy) ||
|
|
22861
22872
|
false;
|
|
22862
22873
|
};
|
|
22863
22874
|
const canSubscriptionUpgradeFromTrialExpired = (subscription) => {
|
|
22864
22875
|
var _a;
|
|
22865
|
-
return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED &&
|
|
22876
|
+
return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
|
|
22866
22877
|
subscription.plan.selfServiceBuy) ||
|
|
22867
22878
|
false;
|
|
22868
22879
|
};
|
|
22869
22880
|
const isSubscriptionNotActive = (subscription) => {
|
|
22870
22881
|
var _a, _b, _c;
|
|
22871
|
-
return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
|
|
22872
|
-
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.CANCELED ||
|
|
22873
|
-
((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED;
|
|
22882
|
+
return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
|
|
22883
|
+
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.CANCELED ||
|
|
22884
|
+
((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED;
|
|
22874
22885
|
};
|
|
22875
22886
|
const isSubscriptionActiveOrPending = (subscription) => {
|
|
22876
22887
|
var _a, _b;
|
|
22877
|
-
return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.ACTIVE ||
|
|
22878
|
-
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.PENDING;
|
|
22888
|
+
return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.ACTIVE ||
|
|
22889
|
+
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.PENDING;
|
|
22879
22890
|
};
|
|
22880
|
-
const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL; };
|
|
22881
|
-
const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED; };
|
|
22891
|
+
const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL; };
|
|
22892
|
+
const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED; };
|
|
22882
22893
|
// Helper function to check if charge is a discount
|
|
22883
22894
|
const isDiscount = (kind) => kind === QuoteChangeKind.DISCOUNT || kind === QuoteChangeKind.FREE_PERIOD_DISCOUNT;
|
|
22884
22895
|
const hasPriceTiers = (charge) => {
|
|
@@ -22947,12 +22958,12 @@ const { Text: Text$f } = Typography;
|
|
|
22947
22958
|
const getSubscriptionStatusText = (subscription) => {
|
|
22948
22959
|
const { cancellationDate, state, evergreen, endDate, trialEndDate, trialStartDate, startDate, trialExpirationAction, } = subscription;
|
|
22949
22960
|
const stateUpperCased = state === null || state === void 0 ? void 0 : state.toUpperCase();
|
|
22950
|
-
const isActive = stateUpperCased === SubscriptionState.ACTIVE;
|
|
22951
|
-
const isPending = stateUpperCased === SubscriptionState.PENDING;
|
|
22952
|
-
const isCanceled = stateUpperCased === SubscriptionState.CANCELED;
|
|
22953
|
-
const isExpired = stateUpperCased === SubscriptionState.EXPIRED;
|
|
22954
|
-
const isTrialExpired = stateUpperCased === SubscriptionState.TRIAL_EXPIRED;
|
|
22955
|
-
const isTrial = stateUpperCased === SubscriptionState.TRIAL;
|
|
22961
|
+
const isActive = stateUpperCased === SubscriptionState$2.ACTIVE;
|
|
22962
|
+
const isPending = stateUpperCased === SubscriptionState$2.PENDING;
|
|
22963
|
+
const isCanceled = stateUpperCased === SubscriptionState$2.CANCELED;
|
|
22964
|
+
const isExpired = stateUpperCased === SubscriptionState$2.EXPIRED;
|
|
22965
|
+
const isTrialExpired = stateUpperCased === SubscriptionState$2.TRIAL_EXPIRED;
|
|
22966
|
+
const isTrial = stateUpperCased === SubscriptionState$2.TRIAL;
|
|
22956
22967
|
if (cancellationDate && (isActive || isPending || isTrial))
|
|
22957
22968
|
return (jsxs(CustomizedTag, { color: "red", children: ["Canceled - ends on ", formatDate(cancellationDate)] }));
|
|
22958
22969
|
if (cancellationDate && isCanceled)
|
|
@@ -23358,9 +23369,9 @@ const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) =>
|
|
|
23358
23369
|
return;
|
|
23359
23370
|
}
|
|
23360
23371
|
const buyingAddonsForCurrentSubscription = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
|
|
23361
|
-
const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL &&
|
|
23372
|
+
const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
|
|
23362
23373
|
upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
|
|
23363
|
-
const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED &&
|
|
23374
|
+
const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
|
|
23364
23375
|
upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
|
|
23365
23376
|
if (isActivatingTrialSubscription || isActivatingExpiredTrialSubscription) {
|
|
23366
23377
|
subscriptionActivate({
|
|
@@ -24223,9 +24234,9 @@ const PriceListCard = ({ hideButton, isSelected, priceList, subscriptions, trial
|
|
|
24223
24234
|
const subscriptionPlan = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(subscription => {
|
|
24224
24235
|
var _a, _b, _c;
|
|
24225
24236
|
return subscription.plan.id === priceList.plan.id &&
|
|
24226
|
-
((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== SubscriptionState.CANCELED &&
|
|
24227
|
-
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== SubscriptionState.EXPIRED &&
|
|
24228
|
-
((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== SubscriptionState.TRIAL_EXPIRED;
|
|
24237
|
+
((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== SubscriptionState$2.CANCELED &&
|
|
24238
|
+
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== SubscriptionState$2.EXPIRED &&
|
|
24239
|
+
((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== SubscriptionState$2.TRIAL_EXPIRED;
|
|
24229
24240
|
});
|
|
24230
24241
|
if (!activeCharge) {
|
|
24231
24242
|
return null;
|
|
@@ -24622,7 +24633,7 @@ const PlanAddonsCard = ({ selectedPriceList, subscriptions, addonPlans, selected
|
|
|
24622
24633
|
const addonSubscriptionIds = currentSubscription === null || currentSubscription === void 0 ? void 0 : currentSubscription.addonSubscriptions;
|
|
24623
24634
|
const addonSubscriptions = addonSubscriptionIds === null || addonSubscriptionIds === void 0 ? void 0 : addonSubscriptionIds.map(addonSubscription => subscriptions.find(subscription => subscription.id === addonSubscription.id));
|
|
24624
24635
|
// filter out cancelled addons
|
|
24625
|
-
const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== SubscriptionState.CANCELED);
|
|
24636
|
+
const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== SubscriptionState$2.CANCELED);
|
|
24626
24637
|
return activeAddonSubscriptions === null || activeAddonSubscriptions === void 0 ? void 0 : activeAddonSubscriptions.some(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.priceList.id) === priceList.id);
|
|
24627
24638
|
}
|
|
24628
24639
|
return (jsxs(Text$4, { className: `bunny-flex bunny-flex-col ${className}`, children: [jsx(AddonPlanModal, { onClose: () => setSelectedAddonPriceList(undefined), priceList: selectedAddonPriceList }), addonPriceLists.length > 0 && (jsxs(Fragment, { children: [jsx("div", { className: "bunny-text-slate-500 bunny-text-xs bunny-font-medium", children: 'Add-on plans'.toUpperCase() }), jsx("div", { className: "bunny-flex bunny-flex-col", children: addonPriceLists.map(addonPriceList => {
|
|
@@ -25430,16 +25441,16 @@ const Subscriptions = ({ handlePortalErrors, companyName, noSubscriptionsCompone
|
|
|
25430
25441
|
const allSubscriptionsInactive = (_c = (_b = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.every(maskedSubscription => {
|
|
25431
25442
|
var _a, _b, _c;
|
|
25432
25443
|
const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
|
|
25433
|
-
return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
|
|
25434
|
-
((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED ||
|
|
25435
|
-
((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.CANCELED);
|
|
25444
|
+
return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
|
|
25445
|
+
((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
|
|
25446
|
+
((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
|
|
25436
25447
|
});
|
|
25437
25448
|
const hasInactiveSubscriptions = (_e = (_d = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _d === void 0 ? void 0 : _d.nodes) === null || _e === void 0 ? void 0 : _e.some(maskedSubscription => {
|
|
25438
25449
|
var _a, _b, _c;
|
|
25439
25450
|
const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
|
|
25440
|
-
return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
|
|
25441
|
-
((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED ||
|
|
25442
|
-
((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.CANCELED);
|
|
25451
|
+
return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
|
|
25452
|
+
((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
|
|
25453
|
+
((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
|
|
25443
25454
|
});
|
|
25444
25455
|
useEffect(() => {
|
|
25445
25456
|
if (allSubscriptionsInactive && subscriptions && subscriptions.length > 0) {
|
package/package.json
CHANGED