Skip to content

Commit

Permalink
chore: cut release (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seavenly authored May 9, 2024
2 parents 76c0090 + a674430 commit 9ec5717
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/modal/v2/parts/BodyContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const BodyContent = () => {
const isQualifying = productMeta?.qualifying;

const useV4Design = productMeta?.useV4Design === 'true';
const useNewCheckoutDesign = features === 'new-checkout-design' ? 'true' : 'false';
const useNewCheckoutDesign = features?.includes('new-checkout-design') ? 'true' : 'false';

// add v4Design class to root html to update lander specific styles to v4
const documentClassName = document.documentElement.className;
Expand Down Expand Up @@ -124,7 +124,7 @@ const BodyContent = () => {
// specific adjacent DOM structure
return (
<Fragment>
{typeof cta !== 'undefined' && features === 'new-checkout-design' ? (
{typeof cta !== 'undefined' && features?.includes('new-checkout-design') ? (
<CheckoutHeader
headline={headline}
subheadline={subheadline}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/v2/parts/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Container = ({ children }) => {
} = useXProps();
const [transitionState] = useTransitionState();
const [loading, setLoading] = useState(false);
const useNewCheckoutDesign = features === 'new-checkout-design' ? 'true' : 'false';
const useNewCheckoutDesign = features?.includes('new-checkout-design') ? 'true' : 'false';

useEffect(() => {
if (transitionState === 'CLOSED') {
Expand Down
2 changes: 1 addition & 1 deletion src/library/controllers/modal/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const memoizedModal = memoizeOnProps(
// eslint-disable-next-line default-param-last
const renderModal = (selector = 'body', newProps, options = { intent: 'render' }) => {
// TODO: determine a more flexible way to handle iframe vs. popup scenarios for our various entrypoints
const context = getTopWindow() === window || features === 'new-checkout-design' ? 'iframe' : 'popup';
const context = getTopWindow() === window || features?.includes('new-checkout-design') ? 'iframe' : 'popup';

if (renderProm && context !== 'popup') {
return renderProm.then(() => newProps && zoidComponent.updateProps(newProps));
Expand Down
4 changes: 2 additions & 2 deletions src/library/zoid/modal/containerTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default ({ uid, frame, prerenderFrame, doc, event, state, props: { cspNon
// cannot overlay across the entire screen
if (context === 'popup') return undefined;

const TRANSITION_DELAY = features === 'new-checkout-design' ? 100 : 300;
const transitionPercent = features === 'new-checkout-design' ? 0 : 5;
const TRANSITION_DELAY = features?.includes('new-checkout-design') ? 100 : 300;
const transitionPercent = features?.includes('new-checkout-design') ? 0 : 5;

const [hijackViewport, replaceViewport] = viewportHijack();

Expand Down
2 changes: 1 addition & 1 deletion src/library/zoid/modal/prerenderTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';

export default ({ doc, props: { cspNonce, features, onError }, event, state }) => {
const ERROR_DELAY = 15000;
const useNewCheckoutDesign = features === 'new-checkout-design' ? 'true' : 'false';
const useNewCheckoutDesign = features?.includes('new-checkout-design') ? 'true' : 'false';
const styles = `
@font-face {
font-family: 'PayPalOpen';
Expand Down
10 changes: 7 additions & 3 deletions src/utils/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import {
getStorageState as getSDKStorageState,
getPayPalDomain as getSDKPayPalDomain,
getDisableSetCookie as getSDKDisableCookie,
getPageType as getSDKPageType,
getPayPalAPIDomain as getSDKPayPalAPIDomain
getPageType as getSDKPageType
} from '@paypal/sdk-client/src';

import { TAG } from './constants';
Expand Down Expand Up @@ -238,8 +237,13 @@ export function getPayPalAPIDomain() {
}
}

// Not using `getPayPalAPIDomain` function call here because it outputs 'cors.api.paypal.com'
// The domain with prefixed 'cors' does not route to logging application.
if (__MESSAGES__.__TARGET__ === 'SDK') {
return getSDKPayPalAPIDomain();
if (getEnv() === 'sandbox') {
return 'https://api.sandbox.paypal.com';
}
return 'https://api.paypal.com';
} else {
const domain = __MESSAGES__.__API_DOMAIN__[`__${getEnv().toUpperCase()}__`];

Expand Down

0 comments on commit 9ec5717

Please sign in to comment.