From 7d1589d1dfb2ef01f83a93fdacfb2be1bb6e7d0a Mon Sep 17 00:00:00 2001 From: Jordan Frankfurt Date: Thu, 15 Dec 2022 16:45:04 -0600 Subject: [PATCH] fixing from cherry-pick process --- src/state/application/hooks.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/state/application/hooks.ts b/src/state/application/hooks.ts index d0f7307f85..b41ac32ce2 100644 --- a/src/state/application/hooks.ts +++ b/src/state/application/hooks.ts @@ -91,6 +91,11 @@ export function useCloseModal(_modal: ApplicationModal): () => void { return useCallback(() => dispatch(setOpenModal(null)), [dispatch]) } +export function useOpenModal(modal: ApplicationModal): () => void { + const dispatch = useAppDispatch() + return useCallback(() => dispatch(setOpenModal(modal)), [dispatch, modal]) +} + export function useToggleWalletModal(): () => void { return useToggleModal(ApplicationModal.WALLET) }