From 740c5e6068693631874edbbb0bb28f70b3221d0d Mon Sep 17 00:00:00 2001 From: truemiller Date: Mon, 9 Sep 2024 17:39:49 +0100 Subject: [PATCH 1/2] refactor: simplify logic, remove New tag --- .../ManageStakingPage/StakingContractSection/index.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx index bbde6ea8..f98d7732 100644 --- a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx +++ b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx @@ -225,14 +225,11 @@ export const StakingContractSection = ({ if (activeStakingProgram === stakingProgram) return StakingProgramStatus.Selected; - // Pearl is not staked, set as Selected if default (Beta) - if (!activeStakingProgram && stakingProgram === defaultStakingProgram) + // not staked, set the default as the Selected contract + if (stakingProgram === defaultStakingProgram) return StakingProgramStatus.Selected; - // Otherwise, highlight Beta as New - if (stakingProgram === StakingProgram.Beta) return StakingProgramStatus.New; - - // Otherwise, no tag + // otherwise, no tag return; }, [activeStakingProgram, defaultStakingProgram, stakingProgram]); From bc0c70d53d765a79da9ad756e636bd4027416f63 Mon Sep 17 00:00:00 2001 From: truemiller Date: Mon, 9 Sep 2024 17:43:37 +0100 Subject: [PATCH 2/2] chore: remove redundant "New" objects --- .../StakingContractSection/StakingContractTag.tsx | 4 +--- frontend/enums/StakingProgramStatus.ts | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx b/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx index 0b6569fe..3cd9d9bd 100644 --- a/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx +++ b/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx @@ -7,9 +7,7 @@ export const StakingContractTag = ({ }: { status?: StakingProgramStatus; }) => { - if (status === StakingProgramStatus.New) { - return New; - } else if (status === StakingProgramStatus.Selected) { + if (status === StakingProgramStatus.Selected) { return Active; } return null; diff --git a/frontend/enums/StakingProgramStatus.ts b/frontend/enums/StakingProgramStatus.ts index d2789f1e..d161434b 100644 --- a/frontend/enums/StakingProgramStatus.ts +++ b/frontend/enums/StakingProgramStatus.ts @@ -1,4 +1,3 @@ export enum StakingProgramStatus { - New = 'new', Selected = 'current', }