Only available in SDK v2.0.0-alpha.10 and up.

Summary

This hook can be used to programmatically show/hide some dynamic modals. The hook needs to be initialized within a child of DynamicContextProvider.

Usage

Available functions and states:

MethodTypeDescription
setShowLinkNewWalletModalDispatch<SetStateAction>Use it to link a new wallet when the user is logged in

Example

const LinkNewWalletButton = () => {
  const { setShowLinkNewWalletModal } = useDynamicModals();
  return (
    <button
      onClick={() => setShowLinkNewWalletModal(true)}
    >
      Link a new wallet
    </button>
  );
};