diff --git a/src/components/Header/NetworkSelector.tsx b/src/components/Header/NetworkSelector.tsx index 082936d237..269b35175a 100644 --- a/src/components/Header/NetworkSelector.tsx +++ b/src/components/Header/NetworkSelector.tsx @@ -3,14 +3,13 @@ import { useWeb3React } from '@web3-react/core' import { getConnection } from 'connection/utils' import { CHAIN_INFO } from 'constants/chainInfo' import { CHAIN_IDS_TO_NAMES, SupportedChainId } from 'constants/chains' -import { useOnClickOutside } from 'hooks/useOnClickOutside' import useParsedQueryString from 'hooks/useParsedQueryString' import usePrevious from 'hooks/usePrevious' import { ParsedQs } from 'qs' import { useCallback, useEffect, useRef } from 'react' import { ArrowDownCircle, ChevronDown } from 'react-feather' import { useHistory } from 'react-router-dom' -import { useModalOpen, useToggleModal } from 'state/application/hooks' +import { useCloseModal, useModalIsOpen, useOpenModal, useToggleModal } from 'state/application/hooks' import { addPopup, ApplicationModal } from 'state/application/reducer' import { updateConnectionError } from 'state/connection/reducer' import { useAppDispatch } from 'state/hooks' @@ -272,17 +271,17 @@ export default function NetworkSelector() { const parsedQs = useParsedQueryString() const { urlChain, urlChainId } = getParsedChainId(parsedQs) const previousUrlChainId = usePrevious(urlChainId) - const node = useRef() - const open = useModalOpen(ApplicationModal.NETWORK_SELECTOR) - const toggle = useToggleModal(ApplicationModal.NETWORK_SELECTOR) - useOnClickOutside(node, open ? toggle : undefined) - + const node = useRef(null) + const isOpen = useModalIsOpen(ApplicationModal.NETWORK_SELECTOR) + const openModal = useOpenModal(ApplicationModal.NETWORK_SELECTOR) + const closeModal = useCloseModal(ApplicationModal.NETWORK_SELECTOR) + const toggleModal = useToggleModal(ApplicationModal.NETWORK_SELECTOR) const history = useHistory() const info = chainId ? CHAIN_INFO[chainId] : undefined const onSelectChain = useCallback( - async (targetChain: number, skipToggle?: boolean) => { + async (targetChain: number, skipClose?: boolean) => { if (!connector) return const connectionType = getConnection(connector).type @@ -297,11 +296,11 @@ export default function NetworkSelector() { dispatch(addPopup({ content: { failedSwitchNetwork: targetChain }, key: `failed-network-switch` })) } - if (!skipToggle) { - toggle() + if (!skipClose) { + closeModal() } }, - [connector, toggle, dispatch] + [connector, closeModal, dispatch] ) useEffect(() => { @@ -332,13 +331,13 @@ export default function NetworkSelector() { } return ( - + {info.label} - {open && ( + {isOpen && ( diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index 5bc03ef529..d17092a93c 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -26,7 +26,7 @@ import styled, { css } from 'styled-components/macro' import { ReactComponent as MenuIcon } from '../../assets/images/menu.svg' import { useOnClickOutside } from '../../hooks/useOnClickOutside' -import { useModalOpen, useToggleModal } from '../../state/application/hooks' +import { useModalIsOpen, useToggleModal } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { ExternalLink } from '../../theme' import { ButtonPrimary } from '../Button' @@ -210,7 +210,7 @@ export default function Menu() { const { account, chainId } = useWeb3React() const node = useRef() - const open = useModalOpen(ApplicationModal.MENU) + const open = useModalIsOpen(ApplicationModal.MENU) const toggleMenu = useToggleModal(ApplicationModal.MENU) useOnClickOutside(node, open ? toggleMenu : undefined) const togglePrivacyPolicy = useToggleModal(ApplicationModal.PRIVACY_POLICY) @@ -334,7 +334,7 @@ const ExternalMenuItem = styled(MenuItem)` export const NewMenu = ({ flyoutAlignment = FlyoutAlignment.RIGHT, ToggleUI, menuItems, ...rest }: NewMenuProps) => { const node = useRef() - const open = useModalOpen(ApplicationModal.POOL_OVERVIEW_OPTIONS) + const open = useModalIsOpen(ApplicationModal.POOL_OVERVIEW_OPTIONS) const toggle = useToggleModal(ApplicationModal.POOL_OVERVIEW_OPTIONS) useOnClickOutside(node, open ? toggle : undefined) const ToggleElement = ToggleUI || StyledMenuIcon diff --git a/src/components/Popups/ClaimPopup.tsx b/src/components/Popups/ClaimPopup.tsx index 9ba0a2dc2c..56ecc406c8 100644 --- a/src/components/Popups/ClaimPopup.tsx +++ b/src/components/Popups/ClaimPopup.tsx @@ -8,7 +8,7 @@ import styled, { keyframes } from 'styled-components/macro' import tokenLogo from '../../assets/images/token-logo.png' import { - useModalOpen, + useModalIsOpen, useShowClaimPopup, useToggleSelfClaimModal, useToggleShowClaimPopup, @@ -62,7 +62,7 @@ export default function ClaimPopup() { const toggleShowClaimPopup = useToggleShowClaimPopup() // toggle for showing this modal - const showClaimModal = useModalOpen(ApplicationModal.SELF_CLAIM) + const showClaimModal = useModalIsOpen(ApplicationModal.SELF_CLAIM) const toggleSelfClaimModal = useToggleSelfClaimModal() const handleToggleSelfClaimModal = useCallback(() => { sendEvent({ diff --git a/src/components/PrivacyPolicy/index.tsx b/src/components/PrivacyPolicy/index.tsx index 7913f287b6..54680ec7fd 100644 --- a/src/components/PrivacyPolicy/index.tsx +++ b/src/components/PrivacyPolicy/index.tsx @@ -8,7 +8,7 @@ import styled from 'styled-components/macro' import { ExternalLink, ThemedText } from 'theme' import { isMobile } from 'utils/userAgent' -import { useModalOpen, useTogglePrivacyPolicy } from '../../state/application/hooks' +import { useModalIsOpen, useTogglePrivacyPolicy } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { AutoColumn } from '../Column' import Modal from '../Modal' @@ -81,7 +81,7 @@ const EXTERNAL_APIS = [ export function PrivacyPolicyModal() { const node = useRef() - const open = useModalOpen(ApplicationModal.PRIVACY_POLICY) + const open = useModalIsOpen(ApplicationModal.PRIVACY_POLICY) const toggle = useTogglePrivacyPolicy() useEffect(() => { diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index be792e93a8..bc7db66889 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -10,7 +10,7 @@ import { Text } from 'rebass' import styled, { ThemeContext } from 'styled-components/macro' import { useOnClickOutside } from '../../hooks/useOnClickOutside' -import { useModalOpen, useToggleSettingsMenu } from '../../state/application/hooks' +import { useModalIsOpen, useToggleSettingsMenu } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { useClientSideRouter, useExpertModeManager } from '../../state/user/hooks' import { ThemedText } from '../../theme' @@ -122,7 +122,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa const { chainId } = useWeb3React() const node = useRef() - const open = useModalOpen(ApplicationModal.SETTINGS) + const open = useModalIsOpen(ApplicationModal.SETTINGS) const toggle = useToggleSettingsMenu() const theme = useContext(ThemeContext) diff --git a/src/components/TopLevelModals/index.tsx b/src/components/TopLevelModals/index.tsx index 4707da0ad3..99f7755c52 100644 --- a/src/components/TopLevelModals/index.tsx +++ b/src/components/TopLevelModals/index.tsx @@ -2,14 +2,14 @@ import { useWeb3React } from '@web3-react/core' import AddressClaimModal from 'components/claim/AddressClaimModal' import ConnectedAccountBlocked from 'components/ConnectedAccountBlocked' import useAccountRiskCheck from 'hooks/useAccountRiskCheck' -import { useModalOpen, useToggleModal } from 'state/application/hooks' +import { useModalIsOpen, useToggleModal } from 'state/application/hooks' import { ApplicationModal } from 'state/application/reducer' export default function TopLevelModals() { - const addressClaimOpen = useModalOpen(ApplicationModal.ADDRESS_CLAIM) + const addressClaimOpen = useModalIsOpen(ApplicationModal.ADDRESS_CLAIM) const addressClaimToggle = useToggleModal(ApplicationModal.ADDRESS_CLAIM) - const blockedAccountModalOpen = useModalOpen(ApplicationModal.BLOCKED_ACCOUNT) + const blockedAccountModalOpen = useModalIsOpen(ApplicationModal.BLOCKED_ACCOUNT) const { account } = useWeb3React() useAccountRiskCheck(account) diff --git a/src/components/WalletModal/index.test.tsx b/src/components/WalletModal/index.test.tsx index 4ee4625abe..ba70aa6f73 100644 --- a/src/components/WalletModal/index.test.tsx +++ b/src/components/WalletModal/index.test.tsx @@ -18,8 +18,8 @@ jest.mock('utils/userAgent', () => ({ jest.mock('.../../state/application/hooks', () => { return { - useModalOpen: (_modal: ApplicationModal) => true, - useWalletModalToggle: () => { + useModalIsOpen: (_modal: ApplicationModal) => true, + useToggleWalletModal: () => { return }, } diff --git a/src/components/WalletModal/index.tsx b/src/components/WalletModal/index.tsx index f17ddd5870..2a5350a9fd 100644 --- a/src/components/WalletModal/index.tsx +++ b/src/components/WalletModal/index.tsx @@ -16,7 +16,7 @@ import styled from 'styled-components/macro' import MetamaskIcon from '../../assets/images/metamask.png' import { ReactComponent as Close } from '../../assets/images/x.svg' import { SUPPORTED_WALLETS } from '../../constants/wallet' -import { useModalOpen, useWalletModalToggle } from '../../state/application/hooks' +import { useModalIsOpen, useToggleWalletModal } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { ExternalLink, ThemedText } from '../../theme' import { isMobile } from '../../utils/userAgent' @@ -129,8 +129,8 @@ export default function WalletModal({ pendingConnector ? state.connection.errorByConnectionType[getConnection(pendingConnector).type] : undefined ) - const walletModalOpen = useModalOpen(ApplicationModal.WALLET) - const toggleWalletModal = useWalletModalToggle() + const walletModalOpen = useModalIsOpen(ApplicationModal.WALLET) + const toggleWalletModal = useToggleWalletModal() const openOptions = useCallback(() => { setWalletView(WALLET_VIEWS.OPTIONS) diff --git a/src/components/Web3Status/index.tsx b/src/components/Web3Status/index.tsx index 5d447b6ff6..3f9872add6 100644 --- a/src/components/Web3Status/index.tsx +++ b/src/components/Web3Status/index.tsx @@ -10,7 +10,7 @@ import styled, { css } from 'styled-components/macro' import { isChainAllowed } from 'utils/switchChain' import { useHasSocks } from '../../hooks/useSocksBalance' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { isTransactionRecent, useAllTransactions } from '../../state/transactions/hooks' import { TransactionDetails } from '../../state/transactions/types' import { shortenAddress } from '../../utils' @@ -139,7 +139,7 @@ function Web3StatusInner() { const hasPendingTransactions = !!pending.length const hasSocks = useHasSocks() - const toggleWalletModal = useWalletModalToggle() + const toggleWalletModal = useToggleWalletModal() if (!chainId) { return null diff --git a/src/components/claim/ClaimModal.tsx b/src/components/claim/ClaimModal.tsx index 23018035d8..a9a82805db 100644 --- a/src/components/claim/ClaimModal.tsx +++ b/src/components/claim/ClaimModal.tsx @@ -9,7 +9,7 @@ import styled from 'styled-components/macro' import Circle from '../../assets/images/blue-loader.svg' import tokenLogo from '../../assets/images/token-logo.png' -import { useModalOpen, useToggleSelfClaimModal } from '../../state/application/hooks' +import { useModalIsOpen, useToggleSelfClaimModal } from '../../state/application/hooks' import { ApplicationModal } from '../../state/application/reducer' import { useClaimCallback, useUserClaimData, useUserUnclaimedAmount } from '../../state/claim/hooks' import { useUserHasSubmittedClaim } from '../../state/transactions/hooks' @@ -48,7 +48,7 @@ const SOCKS_AMOUNT = 1000 const USER_AMOUNT = 400 export default function ClaimModal() { - const isOpen = useModalOpen(ApplicationModal.SELF_CLAIM) + const isOpen = useModalIsOpen(ApplicationModal.SELF_CLAIM) const toggleClaimModal = useToggleSelfClaimModal() const { account, chainId } = useWeb3React() diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index 4ab1957263..9dc6413482 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -46,7 +46,7 @@ import { useIsSwapUnsupported } from '../../hooks/useIsSwapUnsupported' import useTransactionDeadline from '../../hooks/useTransactionDeadline' import { useUSDCValue } from '../../hooks/useUSDCPrice' import { useV3PositionFromTokenId } from '../../hooks/useV3Positions' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { Bound, Field } from '../../state/mint/v3/actions' import { useTransactionAdder } from '../../state/transactions/hooks' import { TransactionType } from '../../state/transactions/types' @@ -83,7 +83,7 @@ export default function AddLiquidity({ }: RouteComponentProps<{ currencyIdA?: string; currencyIdB?: string; feeAmount?: string; tokenId?: string }>) { const { account, chainId, provider } = useWeb3React() const theme = useContext(ThemeContext) - const toggleWalletModal = useWalletModalToggle() // toggle wallet when disconnected + const toggleWalletModal = useToggleWalletModal() // toggle wallet when disconnected const expertMode = useIsExpertMode() const addTransaction = useTransactionAdder() const positionManager = useV3NFTPositionManagerContract() diff --git a/src/pages/AddLiquidityV2/index.tsx b/src/pages/AddLiquidityV2/index.tsx index f2994cc520..77a80721de 100644 --- a/src/pages/AddLiquidityV2/index.tsx +++ b/src/pages/AddLiquidityV2/index.tsx @@ -29,7 +29,7 @@ import { useV2RouterContract } from '../../hooks/useContract' import { useIsSwapUnsupported } from '../../hooks/useIsSwapUnsupported' import useTransactionDeadline from '../../hooks/useTransactionDeadline' import { PairState } from '../../hooks/useV2Pairs' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { Field } from '../../state/mint/actions' import { useDerivedMintInfo, useMintActionHandlers, useMintState } from '../../state/mint/hooks' import { useTransactionAdder } from '../../state/transactions/hooks' @@ -68,7 +68,7 @@ export default function AddLiquidity({ ((currencyA && currencyA.equals(wrappedNativeCurrency)) || (currencyB && currencyB.equals(wrappedNativeCurrency))) ) - const toggleWalletModal = useWalletModalToggle() // toggle wallet when disconnected + const toggleWalletModal = useToggleWalletModal() // toggle wallet when disconnected const expertMode = useIsExpertMode() diff --git a/src/pages/Earn/Manage.tsx b/src/pages/Earn/Manage.tsx index 218d16e36f..d04a3fe0db 100644 --- a/src/pages/Earn/Manage.tsx +++ b/src/pages/Earn/Manage.tsx @@ -23,7 +23,7 @@ import usePrevious from '../../hooks/usePrevious' import { useTotalSupply } from '../../hooks/useTotalSupply' import useUSDCPrice from '../../hooks/useUSDCPrice' import { useV2Pair } from '../../hooks/useV2Pairs' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { useTokenBalance } from '../../state/connection/hooks' import { useStakingInfo } from '../../state/stake/hooks' import { ThemedText } from '../../theme' @@ -142,7 +142,7 @@ export default function Manage({ const valueOfTotalStakedAmountInUSDC = valueOfTotalStakedAmountInWETH && USDPrice?.quote(valueOfTotalStakedAmountInWETH) - const toggleWalletModal = useWalletModalToggle() + const toggleWalletModal = useToggleWalletModal() const handleDepositClick = useCallback(() => { if (account) { diff --git a/src/pages/Pool/index.tsx b/src/pages/Pool/index.tsx index 2b47e2bcdf..cf807fb947 100644 --- a/src/pages/Pool/index.tsx +++ b/src/pages/Pool/index.tsx @@ -11,7 +11,7 @@ import { useV3Positions } from 'hooks/useV3Positions' import { useContext } from 'react' import { BookOpen, ChevronDown, ChevronsRight, Inbox, Layers, PlusCircle } from 'react-feather' import { Link } from 'react-router-dom' -import { useWalletModalToggle } from 'state/application/hooks' +import { useToggleWalletModal } from 'state/application/hooks' import { useUserHideClosedPositions } from 'state/user/hooks' import styled, { ThemeContext } from 'styled-components/macro' import { HideSmall, ThemedText } from 'theme' @@ -128,7 +128,7 @@ function PositionsLoadingPlaceholder() { export default function Pool() { const { account, chainId } = useWeb3React() - const toggleWalletModal = useWalletModalToggle() + const toggleWalletModal = useToggleWalletModal() const theme = useContext(ThemeContext) const [userHideClosedPositions, setUserHideClosedPositions] = useUserHideClosedPositions() diff --git a/src/pages/RemoveLiquidity/index.tsx b/src/pages/RemoveLiquidity/index.tsx index 876212dd78..3796d54d35 100644 --- a/src/pages/RemoveLiquidity/index.tsx +++ b/src/pages/RemoveLiquidity/index.tsx @@ -30,7 +30,7 @@ import { ApprovalState, useApproveCallback } from '../../hooks/useApproveCallbac import { usePairContract, useV2RouterContract } from '../../hooks/useContract' import useDebouncedChangeHandler from '../../hooks/useDebouncedChangeHandler' import useTransactionDeadline from '../../hooks/useTransactionDeadline' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { Field } from '../../state/burn/actions' import { useBurnActionHandlers, useBurnState, useDerivedBurnInfo } from '../../state/burn/hooks' import { useTransactionAdder } from '../../state/transactions/hooks' @@ -58,7 +58,7 @@ export default function RemoveLiquidity({ const theme = useContext(ThemeContext) // toggle wallet when disconnected - const toggleWalletModal = useWalletModalToggle() + const toggleWalletModal = useToggleWalletModal() // burn state const { independentField, typedValue } = useBurnState() diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index d05a783814..5c66a349db 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -42,7 +42,7 @@ import useIsArgentWallet from '../../hooks/useIsArgentWallet' import { useIsSwapUnsupported } from '../../hooks/useIsSwapUnsupported' import { useUSDCValue } from '../../hooks/useUSDCPrice' import useWrapCallback, { WrapErrorText, WrapType } from '../../hooks/useWrapCallback' -import { useWalletModalToggle } from '../../state/application/hooks' +import { useToggleWalletModal } from '../../state/application/hooks' import { Field } from '../../state/swap/actions' import { useDefaultsFromURLSearch, @@ -105,7 +105,7 @@ export default function Swap({ history }: RouteComponentProps) { const theme = useContext(ThemeContext) // toggle wallet when disconnected - const toggleWalletModal = useWalletModalToggle() + const toggleWalletModal = useToggleWalletModal() // for expert mode const [isExpertMode] = useExpertModeManager() diff --git a/src/pages/Vote/Landing.tsx b/src/pages/Vote/Landing.tsx index c699515896..115802ec0f 100644 --- a/src/pages/Vote/Landing.tsx +++ b/src/pages/Vote/Landing.tsx @@ -16,7 +16,7 @@ import { darken } from 'polished' import { useState } from 'react' import { Link } from 'react-router-dom' import { Button } from 'rebass/styled-components' -import { useModalOpen, useToggleDelegateModal } from 'state/application/hooks' +import { useModalIsOpen, useToggleDelegateModal } from 'state/application/hooks' import { ApplicationModal } from 'state/application/reducer' import { useTokenBalance } from 'state/connection/hooks' import { ProposalData, ProposalState } from 'state/governance/hooks' @@ -112,7 +112,7 @@ export default function Landing() { const [hideCancelled, setHideCancelled] = useState(true) // toggle for showing delegation modal - const showDelegateModal = useModalOpen(ApplicationModal.DELEGATE) + const showDelegateModal = useModalIsOpen(ApplicationModal.DELEGATE) const toggleDelegateModal = useToggleDelegateModal() // get data to list all proposals diff --git a/src/pages/Vote/VotePage.tsx b/src/pages/Vote/VotePage.tsx index fb48ea2602..1071cd862b 100644 --- a/src/pages/Vote/VotePage.tsx +++ b/src/pages/Vote/VotePage.tsx @@ -31,7 +31,7 @@ import { import { ZERO_ADDRESS } from '../../constants/misc' import { UNI } from '../../constants/tokens' import { - useModalOpen, + useModalIsOpen, useToggleDelegateModal, useToggleExecuteModal, useToggleQueueModal, @@ -168,19 +168,19 @@ export default function VotePage({ const [voteOption, setVoteOption] = useState(undefined) // modal for casting votes - const showVoteModal = useModalOpen(ApplicationModal.VOTE) + const showVoteModal = useModalIsOpen(ApplicationModal.VOTE) const toggleVoteModal = useToggleVoteModal() // toggle for showing delegation modal - const showDelegateModal = useModalOpen(ApplicationModal.DELEGATE) + const showDelegateModal = useModalIsOpen(ApplicationModal.DELEGATE) const toggleDelegateModal = useToggleDelegateModal() // toggle for showing queue modal - const showQueueModal = useModalOpen(ApplicationModal.QUEUE) + const showQueueModal = useModalIsOpen(ApplicationModal.QUEUE) const toggleQueueModal = useToggleQueueModal() // toggle for showing execute modal - const showExecuteModal = useModalOpen(ApplicationModal.EXECUTE) + const showExecuteModal = useModalIsOpen(ApplicationModal.EXECUTE) const toggleExecuteModal = useToggleExecuteModal() // get and format date from data diff --git a/src/state/application/hooks.ts b/src/state/application/hooks.ts index 944337e81e..5ada0875f4 100644 --- a/src/state/application/hooks.ts +++ b/src/state/application/hooks.ts @@ -5,18 +5,28 @@ import { useAppDispatch, useAppSelector } from 'state/hooks' import { AppState } from '../index' import { addPopup, ApplicationModal, PopupContent, removePopup, setOpenModal } from './reducer' -export function useModalOpen(modal: ApplicationModal): boolean { +export function useModalIsOpen(modal: ApplicationModal): boolean { const openModal = useAppSelector((state: AppState) => state.application.openModal) return openModal === modal } export function useToggleModal(modal: ApplicationModal): () => void { - const open = useModalOpen(modal) + const isOpen = useModalIsOpen(modal) const dispatch = useAppDispatch() - return useCallback(() => dispatch(setOpenModal(open ? null : modal)), [dispatch, modal, open]) + return useCallback(() => dispatch(setOpenModal(isOpen ? null : modal)), [dispatch, modal, isOpen]) } -export function useWalletModalToggle(): () => void { +export function useOpenModal(modal: ApplicationModal): () => void { + const dispatch = useAppDispatch() + return useCallback(() => dispatch(setOpenModal(modal)), [dispatch, modal]) +} + +export function useCloseModal(_modal: ApplicationModal): () => void { + const dispatch = useAppDispatch() + return useCallback(() => dispatch(setOpenModal(null)), [dispatch]) +} + +export function useToggleWalletModal(): () => void { return useToggleModal(ApplicationModal.WALLET) } @@ -25,7 +35,7 @@ export function useToggleSettingsMenu(): () => void { } export function useShowClaimPopup(): boolean { - return useModalOpen(ApplicationModal.CLAIM_POPUP) + return useModalIsOpen(ApplicationModal.CLAIM_POPUP) } export function useToggleShowClaimPopup(): () => void {