diff --git a/package.json b/package.json index 7bfd88b..c8620bd 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frames-react", - "version": "1.1.1", + "version": "1.1.2", "peerDependencies": { "react": ">=16.8" }, diff --git a/src/frames/Frames.tsx b/src/frames/Frames.tsx index 6d5600d..44d4a17 100755 --- a/src/frames/Frames.tsx +++ b/src/frames/Frames.tsx @@ -29,14 +29,17 @@ export class Frames extends Component { } shouldComponentUpdate(nextProps: FramesProps) { - if (nextProps.config.cardholder && nextProps.config.cardholder.name) { - window.Frames.cardholder.name = nextProps.config.cardholder.name; - } - if (nextProps.config.cardholder && nextProps.config.cardholder.billingAddress) { - window.Frames.cardholder.billingAddress = nextProps.config.cardholder.billingAddress; - } - if (nextProps.config.cardholder && nextProps.config.cardholder.phone) { - window.Frames.cardholder.phone = nextProps.config.cardholder.phone; + if (typeof window !== 'undefined' && window.Frames) { + if (nextProps.config.cardholder && nextProps.config.cardholder.name) { + window.Frames.cardholder.name = nextProps.config.cardholder.name; + } + if (nextProps.config.cardholder && nextProps.config.cardholder.billingAddress) { + window.Frames.cardholder.billingAddress = + nextProps.config.cardholder.billingAddress; + } + if (nextProps.config.cardholder && nextProps.config.cardholder.phone) { + window.Frames.cardholder.phone = nextProps.config.cardholder.phone; + } } return true; } diff --git a/src/frames/types/types.tsx b/src/frames/types/types.tsx index 39a5416..66e5388 100755 --- a/src/frames/types/types.tsx +++ b/src/frames/types/types.tsx @@ -23,7 +23,29 @@ export interface FramesLocalization { cardSchemeHeader?: string; } -export type FramesLanguages = 'EN-GB' | 'ES-ES' | 'FR-FR' | 'DE-DE' | 'KR-KR' | 'IT-IT' | 'NL-NL'; +export type FramesLanguages = + | 'AR' + | 'ZH-CH' + | 'ZH-HK' + | 'ZH-TW' + | 'DA-DK' + | 'NL-NL' + | 'EN-GB' + | 'FIL-PH' + | 'FI-FI' + | 'FR-FR' + | 'DE-DE' + | 'HI-IN' + | 'ID-ID' + | 'IT-IT' + | 'JA-JP' + | 'KO-KR' + | 'MS-MY' + | 'NB-NO' + | 'ES-ES' + | 'SV-SE' + | 'TH-TH' + | 'VI-VN'; export type FrameElementIdentifer = 'card-number' | 'expiry-date' | 'cvv';