@bigbinary/neeto-molecules 5.3.18 → 5.3.19

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.
@@ -1333,15 +1333,18 @@ var ProfileMenu = function ProfileMenu(_ref) {
1333
1333
  var isAuthenticated = profileInfo.isAuthenticated;
1334
1334
  var _useTranslation = useTranslation(),
1335
1335
  t = _useTranslation.t;
1336
- var normalizedPlan = (((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan) || "").toLowerCase();
1337
- var isFreePlan = normalizedPlan === "free";
1336
+
1337
+ // A paid plan can be named more than one thing, so the badge follows the
1338
+ // isPro flag the backend sends alongside the plan; the plan name is display
1339
+ // text only.
1340
+ var isPro = Boolean((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.isPro);
1338
1341
  var isOwner = (_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.isOwner;
1339
- var showUpgradeModal = isFreePlan && enableSubscriptionUpgradeRequest && !isOwner;
1342
+ var showUpgradeModal = !isPro && enableSubscriptionUpgradeRequest && !isOwner;
1340
1343
  var getSubscriptionPlanAction = function getSubscriptionPlanAction() {
1341
1344
  if (showUpgradeModal) return {
1342
1345
  onClick: openUpgradeModal
1343
1346
  };
1344
- if (isFreePlan && isOwner && enableSubscriptionUpgradeRequest) {
1347
+ if (!isPro && isOwner && enableSubscriptionUpgradeRequest) {
1345
1348
  var _globalProps$organiza;
1346
1349
  return {
1347
1350
  href: "".concat((_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.authAppUrl, "/admin/billing/overview")
@@ -1351,11 +1354,10 @@ var ProfileMenu = function ProfileMenu(_ref) {
1351
1354
  href: NEETO_AUTH_BILLING_INFO_URL
1352
1355
  };
1353
1356
  };
1354
- var isProPlan = normalizedPlan === "pro";
1355
1357
  var subscriptionPlanLink = _objectSpread$2({
1356
1358
  label: /*#__PURE__*/jsxs("span", {
1357
1359
  className: "flex items-center gap-2",
1358
- children: [globalProps.appName, isProPlan ? /*#__PURE__*/jsx(Badge, {
1360
+ children: [globalProps.appName, isPro ? /*#__PURE__*/jsx(Badge, {
1359
1361
  label: humanize((_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.subscriptionPlan),
1360
1362
  style: {
1361
1363
  "--accent-foreground": "var(--color-amber-950)"