@meterbox/customer-portal 0.1.12 → 0.1.14
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/package.json +2 -2
- package/src/pages/PlansPage.js +24 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meterbox/customer-portal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Drop-in multi-page React customer portal for Meterbox: Account, Plans, Credits. Built on @meterbox/react.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://meterbox.ai",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@meterbox/react": "0.1.
|
|
20
|
+
"@meterbox/react": "0.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=17",
|
package/src/pages/PlansPage.js
CHANGED
|
@@ -117,6 +117,7 @@ function PlansPage({
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
const pickedPlan = (plans || []).find((p) => p.id === picked);
|
|
120
121
|
if (loading) {
|
|
121
122
|
return React.createElement("div", { style: { opacity: 0.6 } }, t("plans.loading"));
|
|
122
123
|
}
|
|
@@ -142,18 +143,29 @@ function PlansPage({
|
|
|
142
143
|
// currentPlanId here would unmount the panel — and its just-rendered
|
|
143
144
|
// success message — the instant a successful change updates
|
|
144
145
|
// currentPlanId to match what was just picked.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
pickedPlan && pickedPlan.stripe_price_monthly_usd == null
|
|
147
|
+
? // No fixed price: not self-serve, so no change to preview.
|
|
148
|
+
React.createElement(
|
|
149
|
+
"p",
|
|
150
|
+
{ style: { fontSize: 13, opacity: 0.7 } },
|
|
151
|
+
t("plans.noFixedPrice", { plan: pickedPlan.name || pickedPlan.id }),
|
|
152
|
+
)
|
|
153
|
+
: picked &&
|
|
154
|
+
(pickedInterval === "annual"
|
|
155
|
+
? React.createElement(
|
|
156
|
+
"p",
|
|
157
|
+
{ style: { fontSize: 13, opacity: 0.7 } },
|
|
158
|
+
t("plans.annualNote"),
|
|
159
|
+
)
|
|
160
|
+
: React.createElement(PlanChangeCard, {
|
|
161
|
+
baseUrl: root,
|
|
162
|
+
customerId,
|
|
163
|
+
customerToken,
|
|
164
|
+
planId: picked,
|
|
165
|
+
scheduledChange,
|
|
166
|
+
fetch: fetchImpl,
|
|
167
|
+
onChanged,
|
|
168
|
+
})),
|
|
157
169
|
);
|
|
158
170
|
}
|
|
159
171
|
|