Skip to content

Commit 82c859b

Browse files
authored
Add collectionOptions to Account Management and Notification Banner (#91)
* Add collectionOptions to Account Management and Notification Banner * Update connect-js version
1 parent bbde155 commit 82c859b

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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.5",
52+
"@stripe/connect-js": "3.3.6",
5353
"@types/jest": "^24.0.25",
5454
"@types/react": "^16.8.0",
5555
"@types/react-dom": "^16.8.0",

src/Components.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,31 @@ export const ConnectAccountOnboarding = ({
7676
return wrapper;
7777
};
7878

79-
export const ConnectAccountManagement = (): JSX.Element => {
80-
const {wrapper} = useCreateComponent('account-management');
79+
export const ConnectAccountManagement = ({
80+
collectionOptions,
81+
}: {
82+
collectionOptions?: CollectionOptions;
83+
}): JSX.Element | null => {
84+
const {wrapper, component: accountManagement} = useCreateComponent('account-management');
85+
86+
useUpdateWithSetter(accountManagement, collectionOptions, (comp, val) =>
87+
comp.setCollectionOptions(val)
88+
);
89+
8190
return wrapper;
8291
};
8392

84-
export const ConnectNotificationBanner = (): JSX.Element => {
85-
const {wrapper} = useCreateComponent('notification-banner');
93+
export const ConnectNotificationBanner = ({
94+
collectionOptions,
95+
}: {
96+
collectionOptions?: CollectionOptions;
97+
}): JSX.Element | null => {
98+
const {wrapper, component: notificationBanner} = useCreateComponent('notification-banner');
99+
100+
useUpdateWithSetter(notificationBanner, collectionOptions, (comp, val) =>
101+
comp.setCollectionOptions(val)
102+
);
103+
86104
return wrapper;
87105
};
88106

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/connect-js@3.3.5":
1443-
version "3.3.5"
1444-
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.5.tgz#cb9344e519d39c9397f180b74e31912eac251fe4"
1445-
integrity sha512-wPr5y5XxSsXAbyonSz6jWsZru62PYOoTxNDxVH467+1PgiYSBqq0jvBItGzI/2bGFe89GTcY/kwqABe0Qg3orw==
1442+
"@stripe/connect-js@3.3.6":
1443+
version "3.3.6"
1444+
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.6.tgz#6e509a410db4ff3a7d6634c5cd71bfc89239f56b"
1445+
integrity sha512-Y1NFI+5cQMgX8kD1MSuHeuY3Ocsz4/Y2c0S3/U9S+TUoY1VHEcIwFW1mpgDdl/rS5hMtlPLIkEScmwOd0Ka4lg==
14461446

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

0 commit comments

Comments
 (0)