@teamrepeat/card-token 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  export const RepeatCardTokenWidget = ({ language, styles, isLocal, shopUUID, onTokenSuccess, onTokenError, onWidgetMount, onWidgetMountError, }) => {
4
4
  const { borderRadius, buttonBackground, buttonColor, color, errorColor, fontFamily, } = styles || {};
@@ -35,16 +35,25 @@ export const RepeatCardTokenWidget = ({ language, styles, isLocal, shopUUID, onT
35
35
  url += `&errorColor=${encodeURIComponent(errorColor)}`;
36
36
  if (fontFamily)
37
37
  url += `&fontFamily=${fontFamily}`;
38
- return (_jsx("div", { style: { width: "100%", height: 600 }, children: !isLoaded ? (_jsx("div", { style: {
39
- width: "100%",
40
- height: "100%",
41
- display: "flex",
42
- alignItems: "center",
43
- justifyContent: "center",
44
- }, children: _jsx("div", { className: "skeletonBox", style: { width: 100, height: 100 } }) })) : (_jsx("iframe", { src: url, style: { width: "100%", height: "100%", border: "none" }, title: "Kort", onLoad: () => {
45
- setIsLoaded(true);
46
- onWidgetMount?.();
47
- }, onError: (error) => {
48
- onWidgetMountError?.(error);
49
- } })) }));
38
+ return (_jsxs("div", { style: { width: "100%", height: 600 }, children: ["(", _jsxs("div", { style: {
39
+ width: "100%",
40
+ height: "100%",
41
+ display: "flex",
42
+ alignItems: "center",
43
+ justifyContent: "center",
44
+ }, children: [_jsx("div", { className: "skeletonBox", style: {
45
+ width: 100,
46
+ height: 100,
47
+ display: isLoaded ? "none" : "block",
48
+ } }), _jsx("iframe", { src: url, style: {
49
+ width: "100%",
50
+ height: "100%",
51
+ border: "none",
52
+ display: isLoaded ? "block" : "none",
53
+ }, title: "Kort", onLoad: () => {
54
+ setIsLoaded(true);
55
+ onWidgetMount?.();
56
+ }, onError: (error) => {
57
+ onWidgetMountError?.(error);
58
+ } })] }), ")"] }));
50
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamrepeat/card-token",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "React hook and iframe component to fetch card tokens",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",