@matchain/matchid-sdk-react 0.1.33 → 0.1.34

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
@@ -9,6 +9,7 @@ type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegra
9
9
  type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
10
10
  type OtherLoginMethodType = 'email' | ISocialLoginMethod
11
11
  type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
12
+ type WalletType ='evm'|'sol'
12
13
  type IEnvConfigType = {
13
14
  endpoints: {
14
15
  back: string;
@@ -74,6 +75,7 @@ type LoginBoxProps = {
74
75
  methods?: OtherLoginMethodType[],
75
76
  inModal?: boolean
76
77
  recommendMethods?: RecommendLoginMethodType[]
78
+ walletMethods?:WalletType[]
77
79
  }
78
80
  type LoginPanelProps = {
79
81
  header?: React.ReactNode
@@ -195,12 +197,13 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
195
197
 
196
198
  declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
197
199
 
198
- declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
200
+ declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
199
201
 
200
- declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
202
+ declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, walletMethods, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
201
203
  loginRender?: ReactNode;
202
204
  methods?: OtherLoginMethodType[];
203
205
  recommendMethods?: RecommendLoginMethodType[];
206
+ walletMethods?: WalletType[];
204
207
  onLoginClick?: () => void;
205
208
  popoverPosition?: PopoverPositionType;
206
209
  popoverType?: PopoverTypeType;
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegra
9
9
  type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
10
10
  type OtherLoginMethodType = 'email' | ISocialLoginMethod
11
11
  type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
12
+ type WalletType ='evm'|'sol'
12
13
  type IEnvConfigType = {
13
14
  endpoints: {
14
15
  back: string;
@@ -74,6 +75,7 @@ type LoginBoxProps = {
74
75
  methods?: OtherLoginMethodType[],
75
76
  inModal?: boolean
76
77
  recommendMethods?: RecommendLoginMethodType[]
78
+ walletMethods?:WalletType[]
77
79
  }
78
80
  type LoginPanelProps = {
79
81
  header?: React.ReactNode
@@ -195,12 +197,13 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
195
197
 
196
198
  declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
197
199
 
198
- declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
200
+ declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
199
201
 
200
- declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
202
+ declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, walletMethods, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
201
203
  loginRender?: ReactNode;
202
204
  methods?: OtherLoginMethodType[];
203
205
  recommendMethods?: RecommendLoginMethodType[];
206
+ walletMethods?: WalletType[];
204
207
  onLoginClick?: () => void;
205
208
  popoverPosition?: PopoverPositionType;
206
209
  popoverType?: PopoverTypeType;
package/dist/index.js CHANGED
@@ -2078,6 +2078,7 @@ function LoginBox({
2078
2078
  "telegram",
2079
2079
  "twitter"
2080
2080
  ],
2081
+ walletMethods = ["evm"],
2081
2082
  inModal = false
2082
2083
  }) {
2083
2084
  const [emailOpen, setEmailOpen] = (0, import_react11.useState)(false);
@@ -2139,20 +2140,20 @@ function LoginBox({
2139
2140
  onClick: () => login("youtube")
2140
2141
  }
2141
2142
  };
2142
- const walletMethods = [
2143
- {
2143
+ const walletMap = {
2144
+ evm: {
2144
2145
  icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EVMDarkIcon, {}),
2145
2146
  activeIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EVMLightIcon, {}),
2146
2147
  name: "EVM",
2147
2148
  onClick: () => login("evm")
2148
2149
  },
2149
- {
2150
+ sol: {
2150
2151
  icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SOLDarkIcon, {}),
2151
2152
  activeIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SOLLightIcon, {}),
2152
2153
  name: "SOL",
2153
2154
  onClick: () => login("sol")
2154
2155
  }
2155
- ];
2156
+ };
2156
2157
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
2157
2158
  (!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "matchid-login-box", children: [
2158
2159
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-list", children: recommendMethods.map((m) => {
@@ -2165,7 +2166,8 @@ function LoginBox({
2165
2166
  showChildren: m == "wallet" && showWallet,
2166
2167
  children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
2167
2168
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
2168
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: walletMethods.map((m2) => {
2169
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: walletMethods.map((n) => {
2170
+ const m2 = walletMap[n];
2169
2171
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2170
2172
  "div",
2171
2173
  {
@@ -2383,6 +2385,7 @@ function LoginButton({
2383
2385
  popoverPosition = "right",
2384
2386
  popoverType = "hover",
2385
2387
  popoverGap = 20,
2388
+ walletMethods,
2386
2389
  ...props
2387
2390
  }) {
2388
2391
  const intl = (0, import_react_intl9.useIntl)();
@@ -2390,7 +2393,16 @@ function LoginButton({
2390
2393
  const [loginOpen, setLoginOpen] = (0, import_react13.useState)(false);
2391
2394
  if (!isLogin) {
2392
2395
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
2393
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(LoginModal, { methods, recommendMethods, isOpen: loginOpen, onClose: () => setLoginOpen(false) }),
2396
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2397
+ LoginModal,
2398
+ {
2399
+ methods,
2400
+ walletMethods,
2401
+ recommendMethods,
2402
+ isOpen: loginOpen,
2403
+ onClose: () => setLoginOpen(false)
2404
+ }
2405
+ ),
2394
2406
  /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
2395
2407
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UnLoginIcon_default, {}),
2396
2408
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_intl9.FormattedMessage, { id: "login" }) })