From 13c5495b1311539598b61079eec54a2f9678ce6a Mon Sep 17 00:00:00 2001 From: Majorfi Date: Fri, 12 Jan 2024 14:43:42 +0100 Subject: [PATCH] fix: remove unused --- apps/common/components/AppHeader.tsx | 4 ---- apps/common/contexts/useWallet.tsx | 10 ---------- apps/common/hooks/useFeatureFlag.tsx | 25 ------------------------- 3 files changed, 39 deletions(-) delete mode 100644 apps/common/hooks/useFeatureFlag.tsx diff --git a/apps/common/components/AppHeader.tsx b/apps/common/components/AppHeader.tsx index 565fbec40..faa1cbb96 100644 --- a/apps/common/components/AppHeader.tsx +++ b/apps/common/components/AppHeader.tsx @@ -166,10 +166,6 @@ export function AppHeader(): ReactElement { return [HOME_MENU, ...APPS[AppName.YCRV].menu]; } - if (pathname.startsWith('/ybal')) { - return [HOME_MENU, ...APPS[AppName.YBAL].menu]; - } - if (pathname.startsWith('/v3')) { return [HOME_MENU, ...APPS[AppName.VAULTSV3].menu]; } diff --git a/apps/common/contexts/useWallet.tsx b/apps/common/contexts/useWallet.tsx index 934fa5299..f21fd2c8f 100755 --- a/apps/common/contexts/useWallet.tsx +++ b/apps/common/contexts/useWallet.tsx @@ -3,16 +3,11 @@ import {useDeepCompareMemo} from '@react-hookz/web'; import {onLoadDone, onLoadStart} from '@yearn-finance/web-lib/contexts/useUI'; import {toAddress, zeroAddress} from '@yearn-finance/web-lib/utils/address'; import { - BAL_TOKEN_ADDRESS, - BALWETH_TOKEN_ADDRESS, CRV_TOKEN_ADDRESS, CVXCRV_TOKEN_ADDRESS, ETH_TOKEN_ADDRESS, - LPYBAL_TOKEN_ADDRESS, LPYCRV_TOKEN_ADDRESS, LPYCRV_V2_TOKEN_ADDRESS, - STYBAL_TOKEN_ADDRESS, - YBAL_TOKEN_ADDRESS, YCRV_CURVE_POOL_V2_ADDRESS, YCRV_TOKEN_ADDRESS, YVBOOST_TOKEN_ADDRESS, @@ -90,11 +85,6 @@ function useYearnTokens({shouldUseForknetBalances}: {shouldUseForknetBalances: b {chainID: 1, address: YVBOOST_TOKEN_ADDRESS}, {chainID: 1, address: YVECRV_TOKEN_ADDRESS}, {chainID: 1, address: CVXCRV_TOKEN_ADDRESS}, - {chainID: 1, address: BAL_TOKEN_ADDRESS}, - {chainID: 1, address: YBAL_TOKEN_ADDRESS}, - {chainID: 1, address: BALWETH_TOKEN_ADDRESS}, - {chainID: 1, address: STYBAL_TOKEN_ADDRESS}, - {chainID: 1, address: LPYBAL_TOKEN_ADDRESS}, {chainID: 1, address: YCRV_CURVE_POOL_V2_ADDRESS}, {chainID: 1, address: LPYCRV_V2_TOKEN_ADDRESS} ] diff --git a/apps/common/hooks/useFeatureFlag.tsx b/apps/common/hooks/useFeatureFlag.tsx deleted file mode 100644 index 5ce79057d..000000000 --- a/apps/common/hooks/useFeatureFlag.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import {useSearchParams} from 'next/navigation'; - -/** - * Determines if a specific feature flag is enabled based on the URL's search parameters. - * - * @function - * @name useFeatureFlag - * @param {string} flag - The name of the feature flag to check for. - * @returns {[boolean]} A boolean value inside an array indicating if the provided feature flag is enabled (`true` if enabled, `false` otherwise). - * - * @example - * const [isFeatureEnabled] = useFeatureFlag('newFeature'); - * if (isFeatureEnabled) { - * // render or implement the new feature - * } - */ -export function useFeatureFlag(flag: string): [boolean] { - const searchParams = useSearchParams(); - - const flags = searchParams.get('features')?.split(',') ?? []; - - const isEnabled = flags.includes(flag); - - return [isEnabled]; -}