@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.
@@ -708,7 +708,7 @@ import { useEffect as useEffect2, useMemo } from "react";
708
708
  import { encodeDeployData } from "viem";
709
709
 
710
710
  // src/context/ModalContext.tsx
711
- import { useState, useCallback, createContext, useContext } from "react";
711
+ import React, { useState, useCallback, createContext, useContext } from "react";
712
712
  import { createPortal } from "react-dom";
713
713
  import { jsx, jsxs } from "react/jsx-runtime";
714
714
  var ModalContext = createContext(null);
@@ -735,7 +735,8 @@ function ModalProvider({ children }) {
735
735
  visible: true,
736
736
  index: modalIndex,
737
737
  zIndex: newZIndex,
738
- content: content({ close: () => closeModal(modalIndex), zIndex: newZIndex })
738
+ content,
739
+ close: () => closeModal(modalIndex)
739
740
  }],
740
741
  highestZIndex: newZIndex
741
742
  };
@@ -750,7 +751,8 @@ function ModalProvider({ children }) {
750
751
  visible: true,
751
752
  index: modalIndex,
752
753
  zIndex: newZIndex,
753
- content: /* @__PURE__ */ jsx(ModalDrawer, { showClose: true, isOpen: true, onClose: () => closeModal(modalIndex), title: props.title, zIndex: newZIndex, onBack: props.onBack, children: /* @__PURE__ */ jsx(props.content, { close: () => closeModal(modalIndex), zIndex: newZIndex }) })
754
+ close: () => closeModal(modalIndex),
755
+ content: ({ close, zIndex }) => /* @__PURE__ */ jsx(ModalDrawer, { showClose: true, isOpen: true, onClose: close, title: props.title, zIndex, onBack: props.onBack, children: /* @__PURE__ */ jsx(props.content, { close, zIndex }) })
754
756
  }],
755
757
  highestZIndex: newZIndex
756
758
  };
@@ -758,7 +760,7 @@ function ModalProvider({ children }) {
758
760
  }, [getNextIndex, closeModal]);
759
761
  const modalElements = modalState.modals.sort((a, b) => b.zIndex - a.zIndex).map(
760
762
  (modal) => modal.visible ? createPortal(
761
- modal.content,
763
+ React.createElement(modal.content, { zIndex: modal.zIndex, close: modal.close }),
762
764
  document.body
763
765
  ) : null
764
766
  );
@@ -7122,7 +7124,7 @@ __export(contact_exports, {
7122
7124
  });
7123
7125
  import { useInfiniteQuery, useQuery as useQuery10, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
7124
7126
  import last from "lodash/last";
7125
- import { useEffect as useEffect28, useRef as useRef6 } from "react";
7127
+ import { useEffect as useEffect28, useMemo as useMemo18, useRef as useRef6 } from "react";
7126
7128
  function useContactList(page_size = 10, type = "Friend") {
7127
7129
  const { token } = useLocalStore_default();
7128
7130
  const limitIdRef = useRef6(0);
@@ -7161,13 +7163,19 @@ function useContactList(page_size = 10, type = "Friend") {
7161
7163
  limitIdRef.current = lastItem?.limit_id || 0;
7162
7164
  }
7163
7165
  }, [contactQuery.data?.pages]);
7164
- return {
7165
- data: (contactQuery.data?.pages ?? []).reduce(
7166
+ useEffect28(() => {
7167
+ console.log("contactQuery.data", contactQuery.data);
7168
+ }, [contactQuery.data]);
7169
+ const data = useMemo18(() => {
7170
+ return (contactQuery.data?.pages ?? []).reduce(
7166
7171
  (a, b) => {
7167
7172
  return a.concat(b?.items ?? []);
7168
7173
  },
7169
7174
  []
7170
- ),
7175
+ );
7176
+ }, [contactQuery.data]);
7177
+ return {
7178
+ data,
7171
7179
  totalCount: contactQuery.hasNextPage ? (last(contactQuery.data?.pages ?? [])?.meta.total ?? 0) + 1 : last(contactQuery.data?.pages ?? [])?.meta.total ?? 0,
7172
7180
  loading: contactQuery.isLoading,
7173
7181
  loadingNextPage: contactQuery.isFetchingNextPage,
@@ -7272,4 +7280,4 @@ export {
7272
7280
  MatchProvider,
7273
7281
  useMatch
7274
7282
  };
7275
- //# sourceMappingURL=chunk-I2V4VRQH.mjs.map
7283
+ //# sourceMappingURL=chunk-BC4HS373.mjs.map