File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function getQRCodeComponent(): QRCodeComponent {
6767 type : "string" ,
6868 queryParam : false ,
6969 required : false ,
70- value : getCSPNonce ,
70+ default : __WEB__ ? getCSPNonce : ( ) => undefined ,
7171 } ,
7272 debug : {
7373 type : "boolean" ,
Original file line number Diff line number Diff line change 44import { destroyElement , type EventEmitterType } from "@krakenjs/belter/src" ;
55import { EVENT , type RenderOptionsType } from "@krakenjs/zoid/src" ;
66import { node , dom , type ChildType } from "@krakenjs/jsx-pragmatic/src" ;
7+ import { getCSPNonce } from "@paypal/sdk-client/src" ;
78
89import { type QRCodeProps } from "./types" ;
910
@@ -113,7 +114,6 @@ export function QRCodeContainer({
113114export function containerTemplate ( {
114115 frame,
115116 prerenderFrame,
116- props,
117117 doc,
118118 uid,
119119 event,
@@ -122,7 +122,7 @@ export function containerTemplate({
122122 return ;
123123 }
124124
125- const { cspNonce } = props ;
125+ const cspNonce = __WEB__ ? getCSPNonce() : undefined ;
126126
127127 return (
128128 < QRCodeContainer
Original file line number Diff line number Diff line change 44import { type RenderOptionsType } from "@krakenjs/zoid/src" ;
55import { node , dom } from "@krakenjs/jsx-pragmatic/src" ;
66import { SpinnerPage } from "@paypal/common-components/src" ;
7+ import { getCSPNonce } from "@paypal/sdk-client/src" ;
78
89import { type QRCodeProps } from "./types" ;
910
1011export function prerenderTemplate ( {
1112 doc,
12- props,
1313 close,
1414} : RenderOptionsType < QRCodeProps > ): ?HTMLElement {
15+ const cspNonce = __WEB__ ? getCSPNonce ( ) : undefined ;
16+
1517 const style = `
1618 #close {
1719 position: absolute;
@@ -42,11 +44,9 @@ export function prerenderTemplate({
4244 ` ;
4345
4446 const children = [
45- < style nonce = { props . cspNonce } innerHTML = { style } /> ,
47+ < style nonce = { cspNonce } innerHTML = { style } /> ,
4648 < a href = "#" id = "close" aria-label = "close" role = "button" onClick = { close } /> ,
4749 ] ;
4850
49- return new SpinnerPage ( { nonce : props . cspNonce } , children ) . render (
50- dom ( { doc } )
51- ) ;
51+ return new SpinnerPage ( { nonce : cspNonce } , children ) . render ( dom ( { doc } ) ) ;
5252}
You can’t perform that action at this time.
0 commit comments