diff --git a/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.tsx b/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.tsx index bddca4d41..5e4beca8f 100644 --- a/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.tsx +++ b/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import { RSK_CHAIN_ID } from '../../../config/chains'; +import { CrocContextProvider } from '../../../contexts/CrocContext'; import { useCurrentChain } from '../../../hooks/useChainStore'; import { AmbientMarketMaking } from './components/AmbientMarketMaking/AmbientMarketMaking'; import { MarketMaking } from './components/MarketMaking/MarketMaking'; @@ -10,7 +11,11 @@ const MarketMakingPage: FC = () => { const currentChainId = useCurrentChain(); if (currentChainId !== RSK_CHAIN_ID) { - return ; + return ( + + + + ); } return ; }; diff --git a/apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/components/PoolsTableAction/PoolsTableAction.tsx b/apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/components/PoolsTableAction/PoolsTableAction.tsx index 98609224d..aca47a13e 100644 --- a/apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/components/PoolsTableAction/PoolsTableAction.tsx +++ b/apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/components/PoolsTableAction/PoolsTableAction.tsx @@ -13,11 +13,9 @@ import { Decimal } from '@sovryn/utils'; import { useAccount } from '../../../../../../../hooks/useAccount'; import { useBlockNumber } from '../../../../../../../hooks/useBlockNumber'; -import { useCurrentChain } from '../../../../../../../hooks/useChainStore'; import { useMaintenance } from '../../../../../../../hooks/useMaintenance'; import { translations } from '../../../../../../../locales/i18n'; import { COMMON_SYMBOLS } from '../../../../../../../utils/asset'; -import { getChainById } from '../../../../../../../utils/chain'; import { useCheckPoolMaintenance } from '../../../../hooks/useCheckPoolMaintenance'; import { useGetUserInfo } from '../../../../hooks/useGetUserInfo'; import { AmmLiquidityPool } from '../../../../utils/AmmLiquidityPool'; @@ -28,10 +26,6 @@ type PoolsTableActionProps = { }; export const PoolsTableAction: FC = ({ pool }) => { - const chainId = useCurrentChain(); - const chain = useMemo(() => getChainById(chainId), [chainId]); - const isBobChain = useMemo(() => chain?.label === 'BOB', [chain?.label]); - const { account } = useAccount(); const { value: block } = useBlockNumber(); @@ -116,7 +110,7 @@ export const PoolsTableAction: FC = ({ pool }) => { style={ButtonStyle.primary} size={ButtonSize.small} text={ - isBobChain && pool.assetA === COMMON_SYMBOLS.SOV + pool.assetA === COMMON_SYMBOLS.SOV ? t(translations.common.withdraw) : t(translations.common.deposit) } @@ -139,16 +133,13 @@ export const PoolsTableAction: FC = ({ pool }) => { onClick={handleAdjustClick} /> )} +

{actionLocked && 'action locked'}

} /> = ({ children }) => { const [croc, setCroc] = useState(defaultContextValue.croc); useEffect(() => { - if (!croc && account) { + if (!croc && account && isBobChain(chainId)) { setCroc(new CrocEnv(getProvider(chainId), signer)); } }, [croc, signer, account, chainId]); diff --git a/apps/frontend/src/router.tsx b/apps/frontend/src/router.tsx index e9ab5e398..600913153 100644 --- a/apps/frontend/src/router.tsx +++ b/apps/frontend/src/router.tsx @@ -117,11 +117,7 @@ const routes = [ }, { path: '/earn/market-making', - element: ( - - - - ), + element: , }, { path: '/earn',