From a37cc0cb82740ba4f06c0bd770f5e56e3f3cad8c Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Wed, 6 Nov 2024 10:12:59 +0100 Subject: [PATCH] fix: Add proposers feature flag --- .../settings/ProposersList/index.tsx | 43 +++++++++++-------- src/utils/chains.ts | 1 + 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/components/settings/ProposersList/index.tsx b/src/components/settings/ProposersList/index.tsx index afda463379..42bf0a91d0 100644 --- a/src/components/settings/ProposersList/index.tsx +++ b/src/components/settings/ProposersList/index.tsx @@ -6,9 +6,11 @@ import Track from '@/components/common/Track' import UpsertProposer from '@/features/proposers/components/UpsertProposer' import DeleteProposerDialog from '@/features/proposers/components/DeleteProposerDialog' import EditProposerDialog from '@/features/proposers/components/EditProposerDialog' +import { useHasFeature } from '@/hooks/useChains' import useProposers from '@/hooks/useProposers' import AddIcon from '@/public/images/common/add.svg' import { SETTINGS_EVENTS } from '@/services/analytics' +import { FEATURES } from '@/utils/chains' import { Box, Button, Grid, Paper, SvgIcon, Typography } from '@mui/material' import EthHashInfo from '@/components/common/EthHashInfo' import ExternalLink from '@/components/common/ExternalLink' @@ -33,6 +35,7 @@ const headCells = [ const ProposersList = () => { const [isAddDialogOpen, setIsAddDialogOpen] = useState() const proposers = useProposers() + const isEnabled = useHasFeature(FEATURES.PROPOSERS) const rows = useMemo(() => { if (!proposers.data) return [] @@ -60,7 +63,7 @@ const ProposersList = () => { actions: { rawValue: '', sticky: true, - content: ( + content: isEnabled && (
@@ -95,24 +98,26 @@ const ProposersList = () => { transactions first. Learn more - - - {(isOk) => ( - - - - )} - - + {isEnabled && ( + + + {(isOk) => ( + + + + )} + + + )} {rows.length > 0 && } diff --git a/src/utils/chains.ts b/src/utils/chains.ts index 3aab4b0a7a..ec3786dd41 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -37,6 +37,7 @@ export enum FEATURES { STAKING_BANNER = 'STAKING_BANNER', MULTI_CHAIN_SAFE_CREATION = 'MULTI_CHAIN_SAFE_CREATION', MULTI_CHAIN_SAFE_ADD_NETWORK = 'MULTI_CHAIN_SAFE_ADD_NETWORK', + PROPOSERS = 'PROPOSERS', } export const FeatureRoutes = {