Skip to content

Commit 81292c0

Browse files
add payout details to reactjs
1 parent 8c7306e commit 81292c0

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@babel/preset-react": "7.18.6",
5252
"@rollup/plugin-json": "^6.0.0",
5353
"@rollup/plugin-replace": "^2.3.1",
54-
"@stripe/connect-js": "3.3.36-preview-1",
54+
"@stripe/connect-js": "3.3.37-preview-1",
5555
"@types/jest": "^24.0.25",
5656
"@types/react": "^16.8.0",
5757
"@types/react-dom": "^16.8.0",
@@ -90,7 +90,7 @@
9090
"zx": "^4.2.0"
9191
},
9292
"peerDependencies": {
93-
"@stripe/connect-js": ">=3.3.36-preview-1",
93+
"@stripe/connect-js": ">=3.3.37-preview-1",
9494
"react": ">=16.8.0",
9595
"react-dom": ">=16.8.0"
9696
}

src/Components.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,33 @@ export const ConnectInstantPayoutsPromotion = ({
953953

954954
return wrapper;
955955
};
956+
957+
export const ConnectPayoutDetails = ({
958+
payout,
959+
onClose,
960+
onLoadError,
961+
onLoaderStart,
962+
}: {
963+
/**
964+
* @param payout the ID of `payout` to be displayed.
965+
*/
966+
payout: string;
967+
onClose: () => void;
968+
} & CommonComponentProps): JSX.Element | null => {
969+
const {wrapper, component: payoutDetails} =
970+
useCreateComponent('payout-details');
971+
972+
useUpdateWithSetter(payoutDetails, payout, (comp, val) =>
973+
comp.setPayout(val)
974+
);
975+
useUpdateWithSetter(payoutDetails, onClose, (comp, val) =>
976+
comp.setOnClose(val)
977+
);
978+
useUpdateWithSetter(payoutDetails, onLoaderStart, (comp, val) => {
979+
comp.setOnLoaderStart(val);
980+
});
981+
useUpdateWithSetter(payoutDetails, onLoadError, (comp, val) => {
982+
comp.setOnLoadError(val);
983+
});
984+
return wrapper;
985+
};

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,10 +1510,10 @@
15101510
dependencies:
15111511
"@sinonjs/commons" "^3.0.0"
15121512

1513-
"@stripe/[email protected].36-preview-1":
1514-
version "3.3.36-preview-1"
1515-
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.36-preview-1.tgz#fa5b2b721ff593600dfdbfca033d179d3c11d12c"
1516-
integrity sha512-yi3ze/TA5kPiAcwCnPnjPVpRMqqveIYYNHKKaun194GwB+DeIjDZoZSlv5LueOvyvo4IU6YhTMPxLii7kz9ILg==
1513+
"@stripe/[email protected].37-preview-1":
1514+
version "3.3.37-preview-1"
1515+
resolved "https://registry.yarnpkg.com/@stripe/connect-js/-/connect-js-3.3.37-preview-1.tgz#948c89eefecc2c52a876b99371afab07ed81b5e7"
1516+
integrity sha512-prhfflpnukHUYNLZIZoAeVkou2ZIlCiqcCq4SPBs6MbNNd40tkIpDcMWXpAzz5Yc3YOcaMEwJjB510dextdYvA==
15171517

15181518
"@tootallnate/once@2":
15191519
version "2.0.0"

0 commit comments

Comments
 (0)