Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…onents into axo-component-poc
  • Loading branch information
siddy2181 committed Nov 14, 2023
2 parents 0fa02c0 + f754079 commit c764222
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .bundlemonrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"path": "size.min.js",
"compression": "gzip",
"maxPercentIncrease": 3,
"maxPercentIncrease": 3.6,
"maxSize": "76kb"
}
],
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## <small>5.0.285 (2023-11-07)</small>

* Venmo overlay (#2271) ([294709b](https://github.com/paypal/paypal-checkout-components/commit/294709b)), closes [#2271](https://github.com/paypal/paypal-checkout-components/issues/2271)



## <small>5.0.284 (2023-11-02)</small>

* Update CODE_OF_CONDUCT.md (#2268) ([6caee02](https://github.com/paypal/paypal-checkout-components/commit/6caee02)), closes [#2268](https://github.com/paypal/paypal-checkout-components/issues/2268)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paypal/checkout-components",
"version": "5.0.284",
"version": "5.0.285",
"description": "PayPal Checkout components, for integrating checkout products.",
"main": "index.js",
"scripts": {
Expand Down
51 changes: 37 additions & 14 deletions src/zoid/checkout/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import {
inlineMemoize,
} from "@krakenjs/belter/src";
import { FUNDING } from "@paypal/sdk-constants/src";
import { SpinnerPage, Overlay } from "@paypal/common-components/src";
import {
SpinnerPage,
Overlay,
VenmoOverlay,
} from "@paypal/common-components/src";

import { getSessionID } from "../../lib";
import { containerContent } from "../content";
Expand Down Expand Up @@ -81,20 +85,38 @@ export function getCheckoutComponent(): CheckoutComponent {
const {
nonce,
locale: { lang },
fundingSource,
} = props;
const content = containerContent("PayPal")[lang];
return (
<Overlay
context={context}
close={close}
focus={focus}
event={event}
frame={frame}
prerenderFrame={prerenderFrame}
content={content}
nonce={nonce}
/>
).render(dom({ doc }));
const isVenmo = fundingSource === FUNDING.VENMO;
const browserLanguage = isVenmo ? "en" : lang;
const content = containerContent(fundingSource)[browserLanguage];
if (isVenmo) {
return (
<VenmoOverlay
context={context}
close={close}
focus={focus}
event={event}
frame={frame}
prerenderFrame={prerenderFrame}
content={content}
nonce={nonce}
/>
).render(dom({ doc }));
} else {
return (
<Overlay
context={context}
close={close}
focus={focus}
event={event}
frame={frame}
prerenderFrame={prerenderFrame}
content={content}
nonce={nonce}
/>
).render(dom({ doc }));
}
},

props: {
Expand Down Expand Up @@ -197,6 +219,7 @@ export function getCheckoutComponent(): CheckoutComponent {
type: "string",
queryParam: true,
default: () => FUNDING.PAYPAL,
allowDelegate: true,
},

standaloneFundingSource: {
Expand Down
Loading

0 comments on commit c764222

Please sign in to comment.