Skip to content

Commit 3e25989

Browse files
Updated connect.js version and added StepChange to account onboarding (#118)
* Updated connect.js version and added StepChange to account onboarding * Update peer dependencies
1 parent f3bc75b commit 3e25989

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@babel/preset-react": "7.18.6",
5050
"@rollup/plugin-json": "^6.0.0",
5151
"@rollup/plugin-replace": "^2.3.1",
52-
"@stripe/connect-js": "3.3.12",
52+
"@stripe/connect-js": "3.3.13",
5353
"@types/jest": "^24.0.25",
5454
"@types/react": "^16.8.0",
5555
"@types/react-dom": "^16.8.0",
@@ -84,7 +84,7 @@
8484
"zx": "^4.2.0"
8585
},
8686
"peerDependencies": {
87-
"@stripe/connect-js": ">=3.3.11",
87+
"@stripe/connect-js": ">=3.3.13",
8888
"react": ">=16.8.0",
8989
"react-dom": ">=16.8.0"
9090
}

src/Components.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import {useCreateComponent} from './useCreateComponent';
22
import {useUpdateWithSetter} from './utils/useUpdateWithSetter';
3-
import {LoadError, LoaderStart, NotificationCount} from '@stripe/connect-js';
3+
import {
4+
LoadError,
5+
LoaderStart,
6+
NotificationCount,
7+
StepChange,
8+
} from '@stripe/connect-js';
49

510
export type CommonComponentProps = {
611
onLoaderStart?: ({elementTagName}: LoaderStart) => void;
@@ -83,8 +88,10 @@ export const ConnectAccountOnboarding = ({
8388
collectionOptions,
8489
onLoadError,
8590
onLoaderStart,
91+
onStepChange,
8692
}: {
8793
onExit: () => void;
94+
onStepChange?: (stepChange: StepChange) => void;
8895
recipientTermsOfServiceUrl?: string;
8996
fullTermsOfServiceUrl?: string;
9097
privacyPolicyUrl?: string;
@@ -116,6 +123,9 @@ export const ConnectAccountOnboarding = ({
116123
useUpdateWithSetter(onboarding, onLoadError, (comp, val) => {
117124
comp.setOnLoadError(val);
118125
});
126+
useUpdateWithSetter(onboarding, onStepChange, (comp, val) =>
127+
comp.setOnStepChange(val)
128+
);
119129

120130
return wrapper;
121131
};

src/utils/useUpdateWithSetter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import React from 'react';
22
import {CollectionOptions} from '../Components';
3-
import {LoadError, LoaderStart, NotificationCount} from '@stripe/connect-js';
3+
import {
4+
LoadError,
5+
LoaderStart,
6+
NotificationCount,
7+
StepChange,
8+
} from '@stripe/connect-js';
49

510
export const useUpdateWithSetter = <
611
T extends HTMLElement,
@@ -12,6 +17,7 @@ export const useUpdateWithSetter = <
1217
| ((notificationCount: NotificationCount) => void)
1318
| ((loaderStart: LoaderStart) => void)
1419
| ((loaderError: LoadError) => void)
20+
| ((stepChange: StepChange) => void)
1521
| undefined
1622
>(
1723
component: T | null,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,10 +1439,10 @@
14391439
dependencies:
14401440
"@sinonjs/commons" "^3.0.0"
14411441

1442-
"@stripe/[email protected].12":
1443-
version "3.3.12"
1444-
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.12.tgz#35bd6c20b88b3155d30735951adde902d24380bb"
1445-
integrity sha512-hXbgvGq9Lb6BYgsb8lcbjL76Yqsxr0yAj6T9ZFTfUK0O4otI5GSEWum9do9rf/E5OfYy6fR1FG/77Jve2w1o6Q==
1442+
"@stripe/[email protected].13":
1443+
version "3.3.13"
1444+
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.13.tgz#09338c30c251a48e24db5e0d14950158c2e38335"
1445+
integrity sha512-WSSZngnrEqQ2yFPbc5xN0S2fgZDATI0h0uqGbW2mzTuo5HSOGcFvf240UCNnVpmxVY92mIycMq5tpYncsx6/xQ==
14461446

14471447
"@tootallnate/once@2":
14481448
version "2.0.0"

0 commit comments

Comments
 (0)