Skip to content

Commit

Permalink
HOTIFX: Adding callback to soulname modal
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Aug 3, 2023
1 parent 95ede38 commit b80fe55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/masa-interface/masa-interface.tsx
Expand Up @@ -77,6 +77,7 @@ export const MasaInterface = ({
verbose,
openConnectModal,
setRainbowkKitModalCallback,
modalCallback,
// setForcedPage,
// switchNetworkNew,
useRainbowKit,
Expand Down Expand Up @@ -204,7 +205,12 @@ export const MasaInterface = ({
scope?.includes('soulname')
) {
setModalOpen?.(false);
openCreateSoulnameModal?.({});
openCreateSoulnameModal?.({
onSuccess: () => {
if(modalCallback) modalCallback();
},
closeOnSuccess: true
});
return 'createSoulname';
}

Expand Down Expand Up @@ -256,6 +262,7 @@ export const MasaInterface = ({
signer,
isModalOpen,
setModalOpen,
modalCallback,
setRainbowkKitModalCallback,
signer,
]);
Expand Down
3 changes: 3 additions & 0 deletions src/provider/masa-context-provider.tsx
Expand Up @@ -226,6 +226,7 @@ export const MasaContextProvider = ({
isModalOpen,
setModalOpen,
setModalCallback,
modalCallback,
closeModal,
forcedPage,
setForcedPage,
Expand Down Expand Up @@ -361,6 +362,7 @@ export const MasaContextProvider = ({
useModalSize,
openGallery,
modalSize,
modalCallback,

// wallet
walletAddress: accountAddress,
Expand Down Expand Up @@ -484,6 +486,7 @@ export const MasaContextProvider = ({
useModalSize,
openGallery,
modalSize,
modalCallback,

// wallet

Expand Down
1 change: 1 addition & 0 deletions src/provider/masa-shape.ts
Expand Up @@ -48,6 +48,7 @@ export interface MasaShape {
modalSize?: { width: number; height: number } | null;
useModalSize?: (size: { width: number; height: number }) => void;
openGallery?: (callback?: () => void) => void;
modalCallback?: (() => void) | null;

// wallet
walletAddress?: string;
Expand Down
2 changes: 2 additions & 0 deletions src/provider/modules/modal/modal.ts
Expand Up @@ -8,6 +8,7 @@ export const useModal = (
isModalOpen: boolean;
closeModal: (forceCallback?: boolean) => void;
setModalOpen: (modalOpen: boolean) => void;
modalCallback: (() => void) | null;
setModalCallback: (callback: () => void) => void;
forcedPage: string | null;
setForcedPage?: (page: null | string) => void;
Expand Down Expand Up @@ -110,6 +111,7 @@ export const useModal = (
closeModal,
setModalOpen,
setModalCallback,
modalCallback,
forcedPage,
setForcedPage,
openMintSoulnameModal,
Expand Down

0 comments on commit b80fe55

Please sign in to comment.