@yourself_id/siwys-react-js 0.16.0 → 0.16.1-make-on-siwys-press-optional.1

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.
package/dist/index.d.mts CHANGED
@@ -15,10 +15,10 @@ declare const SiwysButton: React.FC<ButtonProps>;
15
15
  type ThemeProp = "light" | "dark";
16
16
  interface SignInProps {
17
17
  challengeDID: string;
18
- onSiwysPress: () => void;
19
18
  challengeBaseUrl?: string;
20
19
  isCYS?: boolean;
21
20
  createChallengeUrl?: string;
21
+ onSiwysPress?: () => void;
22
22
  pollForAuthUrl?: string;
23
23
  successComponent?: React.ReactNode;
24
24
  theme?: ThemeProp;
package/dist/index.d.ts CHANGED
@@ -15,10 +15,10 @@ declare const SiwysButton: React.FC<ButtonProps>;
15
15
  type ThemeProp = "light" | "dark";
16
16
  interface SignInProps {
17
17
  challengeDID: string;
18
- onSiwysPress: () => void;
19
18
  challengeBaseUrl?: string;
20
19
  isCYS?: boolean;
21
20
  createChallengeUrl?: string;
21
+ onSiwysPress?: () => void;
22
22
  pollForAuthUrl?: string;
23
23
  successComponent?: React.ReactNode;
24
24
  theme?: ThemeProp;
package/dist/index.js CHANGED
@@ -1114,6 +1114,16 @@ var SignInWithYourSelf = function(param) {
1114
1114
  var appStoreURL = "https://apps.apple.com/us/app/self-id/id1663745416";
1115
1115
  window.open(appStoreURL, "_blank");
1116
1116
  };
1117
+ var defaultSiwysClick = (0, import_react4.useCallback)(function() {
1118
+ if (onSiwysPress) {
1119
+ onSiwysPress();
1120
+ return;
1121
+ }
1122
+ window.open(challengeUrl, "_blank");
1123
+ }, [
1124
+ challengeUrl,
1125
+ onSiwysPress
1126
+ ]);
1117
1127
  if (isAuthenticated) {
1118
1128
  return /* @__PURE__ */ import_react4.default.createElement(Wrapper, null, successComponent);
1119
1129
  }
@@ -1139,11 +1149,11 @@ var SignInWithYourSelf = function(param) {
1139
1149
  level: "H"
1140
1150
  })), isCYS ? /* @__PURE__ */ import_react4.default.createElement(CysButton, {
1141
1151
  colorTheme: theme,
1142
- onClick: onSiwysPress,
1152
+ onClick: defaultSiwysClick,
1143
1153
  glow: true
1144
1154
  }) : /* @__PURE__ */ import_react4.default.createElement(SiwysButton, {
1145
1155
  colorTheme: theme,
1146
- onClick: onSiwysPress,
1156
+ onClick: defaultSiwysClick,
1147
1157
  glow: true
1148
1158
  })), /* @__PURE__ */ import_react4.default.createElement(InstructionsContainer, null, /* @__PURE__ */ import_react4.default.createElement(InstructionsTitle, {
1149
1159
  $theme: theme