@matchain/matchid-sdk-react 0.1.53-alpha.13 → 0.1.53-alpha.15

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.
@@ -12,7 +12,7 @@ import {
12
12
  useTransaction,
13
13
  useUserInfo,
14
14
  useWallet
15
- } from "../chunk-I2V4VRQH.mjs";
15
+ } from "../chunk-BC4HS373.mjs";
16
16
  import "../chunk-JX73EY6V.mjs";
17
17
  import "../chunk-UA6XHZHX.mjs";
18
18
  import "../chunk-IZOOVZAD.mjs";
@@ -9,11 +9,12 @@ import React, { ReactNode } from 'react';
9
9
  import * as viem__types_actions_siwe_verifySiweMessage from 'viem/_types/actions/siwe/verifySiweMessage';
10
10
  import * as _tanstack_react_query from '@tanstack/react-query';
11
11
 
12
+ interface ModalProps {
13
+ close: () => void;
14
+ zIndex: number;
15
+ }
12
16
  interface ModalContextType {
13
- show: (content: (props: {
14
- close: () => void;
15
- zIndex: number;
16
- }) => ReactNode, index?: number) => void;
17
+ show: (content: React.FC<ModalProps>, index?: number) => void;
17
18
  open: (props: {
18
19
  title: ReactNode;
19
20
  content: React.ComponentType<{
@@ -9,11 +9,12 @@ import React, { ReactNode } from 'react';
9
9
  import * as viem__types_actions_siwe_verifySiweMessage from 'viem/_types/actions/siwe/verifySiweMessage';
10
10
  import * as _tanstack_react_query from '@tanstack/react-query';
11
11
 
12
+ interface ModalProps {
13
+ close: () => void;
14
+ zIndex: number;
15
+ }
12
16
  interface ModalContextType {
13
- show: (content: (props: {
14
- close: () => void;
15
- zIndex: number;
16
- }) => ReactNode, index?: number) => void;
17
+ show: (content: React.FC<ModalProps>, index?: number) => void;
17
18
  open: (props: {
18
19
  title: ReactNode;
19
20
  content: React.ComponentType<{
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-VrV1kYga.mjs';
3
- export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-DjbH13zc.mjs';
3
+ export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-Dus4QPjO.mjs';
4
4
  export { i as Components } from './index-CLYi12dP.mjs';
5
5
  export { i as UI } from './index-DC4F1u-w.mjs';
6
6
  export { i as Api } from './index-BrzFSkOe.mjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { I as IMatchEvents, a as IEnvConfigType, L as LocaleType, W as WalletConfigType } from './types-VrV1kYga.js';
3
- export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-zc2GEzJ9.js';
3
+ export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-D5yzH62h.js';
4
4
  export { i as Components } from './index-BikcLg_6.js';
5
5
  export { i as UI } from './index-C0UKUm0h.js';
6
6
  export { i as Api } from './index-BgdY5xdW.js';
package/dist/index.js CHANGED
@@ -2472,7 +2472,7 @@ var import_react10 = require("react");
2472
2472
  var import_viem4 = require("viem");
2473
2473
 
2474
2474
  // src/context/ModalContext.tsx
2475
- var import_react9 = require("react");
2475
+ var import_react9 = __toESM(require("react"));
2476
2476
  var import_react_dom = require("react-dom");
2477
2477
 
2478
2478
  // src/ui/index.ts
@@ -3011,7 +3011,8 @@ function ModalProvider({ children }) {
3011
3011
  visible: true,
3012
3012
  index: modalIndex,
3013
3013
  zIndex: newZIndex,
3014
- content: content({ close: () => closeModal(modalIndex), zIndex: newZIndex })
3014
+ content,
3015
+ close: () => closeModal(modalIndex)
3015
3016
  }],
3016
3017
  highestZIndex: newZIndex
3017
3018
  };
@@ -3026,7 +3027,8 @@ function ModalProvider({ children }) {
3026
3027
  visible: true,
3027
3028
  index: modalIndex,
3028
3029
  zIndex: newZIndex,
3029
- content: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ModalDrawer, { showClose: true, isOpen: true, onClose: () => closeModal(modalIndex), title: props.title, zIndex: newZIndex, onBack: props.onBack, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(props.content, { close: () => closeModal(modalIndex), zIndex: newZIndex }) })
3030
+ close: () => closeModal(modalIndex),
3031
+ content: ({ close, zIndex }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ModalDrawer, { showClose: true, isOpen: true, onClose: close, title: props.title, zIndex, onBack: props.onBack, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(props.content, { close, zIndex }) })
3030
3032
  }],
3031
3033
  highestZIndex: newZIndex
3032
3034
  };
@@ -3034,7 +3036,7 @@ function ModalProvider({ children }) {
3034
3036
  }, [getNextIndex, closeModal]);
3035
3037
  const modalElements = modalState.modals.sort((a, b) => b.zIndex - a.zIndex).map(
3036
3038
  (modal) => modal.visible ? (0, import_react_dom.createPortal)(
3037
- modal.content,
3039
+ import_react9.default.createElement(modal.content, { zIndex: modal.zIndex, close: modal.close }),
3038
3040
  document.body
3039
3041
  ) : null
3040
3042
  );
@@ -6731,13 +6733,19 @@ function useContactList(page_size = 10, type = "Friend") {
6731
6733
  limitIdRef.current = lastItem?.limit_id || 0;
6732
6734
  }
6733
6735
  }, [contactQuery.data?.pages]);
6734
- return {
6735
- data: (contactQuery.data?.pages ?? []).reduce(
6736
+ (0, import_react34.useEffect)(() => {
6737
+ console.log("contactQuery.data", contactQuery.data);
6738
+ }, [contactQuery.data]);
6739
+ const data = (0, import_react34.useMemo)(() => {
6740
+ return (contactQuery.data?.pages ?? []).reduce(
6736
6741
  (a, b) => {
6737
6742
  return a.concat(b?.items ?? []);
6738
6743
  },
6739
6744
  []
6740
- ),
6745
+ );
6746
+ }, [contactQuery.data]);
6747
+ return {
6748
+ data,
6741
6749
  totalCount: contactQuery.hasNextPage ? ((0, import_last.default)(contactQuery.data?.pages ?? [])?.meta.total ?? 0) + 1 : (0, import_last.default)(contactQuery.data?.pages ?? [])?.meta.total ?? 0,
6742
6750
  loading: contactQuery.isLoading,
6743
6751
  loadingNextPage: contactQuery.isFetchingNextPage,