@meterbox/customer-portal 0.1.18 → 0.1.20
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 +5 -4
- package/package.json +9 -2
- package/src/pages/AccountPage.js +7 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ like "cancel" or "upgrade to Pro" in your emails or app:
|
|
|
50
50
|
|
|
51
51
|
`cancel` opens the cancel flow on the Account page, at its "Why are you
|
|
52
52
|
cancelling?" step. `change_plan` opens the Plans page with that plan picked:
|
|
53
|
-
|
|
53
|
+
what it bills and when, and the "Change now" / "Schedule for end of period"
|
|
54
54
|
buttons. A plan that's the customer's current one, or that isn't published,
|
|
55
55
|
picks nothing. The action applies once; moving to another tab drops it.
|
|
56
56
|
|
|
@@ -95,9 +95,10 @@ override it.
|
|
|
95
95
|
- **Plans**: the published plans (`GET /v1/customer-portal/:id/plans`) in a
|
|
96
96
|
`<PricingTable>` (monthly/annual toggle and each plan's model rates
|
|
97
97
|
included) + inline
|
|
98
|
-
`<PlanChangeCard>` for a monthly pick:
|
|
99
|
-
/ "Schedule for end of period" actions, so picking a plan actually
|
|
100
|
-
it, not just previews it
|
|
98
|
+
`<PlanChangeCard>` for a monthly pick: what it bills and when, plus "Change
|
|
99
|
+
now" / "Schedule for end of period" actions, so picking a plan actually
|
|
100
|
+
applies it, not just previews it (a paid plan that needs a payment method
|
|
101
|
+
goes through checkout first). `onPlanSelect` fires with `(plan,
|
|
101
102
|
billingInterval)` either way. The inline card only covers monthly:
|
|
102
103
|
`subscription/preview` and `subscription/change` don't prorate an annual
|
|
103
104
|
commitment yet, so an annual pick shows a short note instead of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meterbox/customer-portal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"README.md",
|
|
11
11
|
"LICENSE"
|
|
12
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"format": "prettier --write .",
|
|
15
|
+
"format:check": "prettier --check ."
|
|
16
|
+
},
|
|
13
17
|
"engines": {
|
|
14
18
|
"node": ">=18"
|
|
15
19
|
},
|
|
@@ -17,12 +21,15 @@
|
|
|
17
21
|
"access": "public"
|
|
18
22
|
},
|
|
19
23
|
"dependencies": {
|
|
20
|
-
"@meterbox/react": "0.1.
|
|
24
|
+
"@meterbox/react": "0.1.18"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
27
|
"react": ">=17",
|
|
24
28
|
"react-dom": ">=17"
|
|
25
29
|
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"prettier": "^3.9.10"
|
|
32
|
+
},
|
|
26
33
|
"keywords": [
|
|
27
34
|
"meterbox",
|
|
28
35
|
"react",
|
package/src/pages/AccountPage.js
CHANGED
|
@@ -61,7 +61,13 @@ async function fetchMe({ baseUrl, customerId, customerToken, fetchImpl }) {
|
|
|
61
61
|
return json;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function AccountPage({
|
|
64
|
+
function AccountPage({
|
|
65
|
+
baseUrl: baseUrlProp,
|
|
66
|
+
customerId,
|
|
67
|
+
customerToken,
|
|
68
|
+
startCancel,
|
|
69
|
+
fetch: fetchImpl,
|
|
70
|
+
}) {
|
|
65
71
|
const baseUrl = useBaseUrl(baseUrlProp);
|
|
66
72
|
const { t, date } = useI18n();
|
|
67
73
|
const [me, setMe] = React.useState(null);
|