diff --git a/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx b/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx index 3cd9d9bdd..cd9e525df 100644 --- a/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx +++ b/frontend/components/ManageStakingPage/StakingContractSection/StakingContractTag.tsx @@ -5,7 +5,7 @@ import { StakingProgramStatus } from '@/enums/StakingProgramStatus'; export const StakingContractTag = ({ status, }: { - status?: StakingProgramStatus; + status: StakingProgramStatus | null; }) => { if (status === StakingProgramStatus.Selected) { return Active; diff --git a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx index f98d77329..8bc4613a1 100644 --- a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx +++ b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx @@ -222,15 +222,15 @@ export const StakingContractSection = ({ ]); const contractTagStatus = useMemo(() => { - if (activeStakingProgram === stakingProgram) + if (activeStakingProgram === stakingProgram) { return StakingProgramStatus.Selected; + } - // not staked, set the default as the Selected contract - if (stakingProgram === defaultStakingProgram) + if (!activeStakingProgram && stakingProgram === defaultStakingProgram) { return StakingProgramStatus.Selected; + } - // otherwise, no tag - return; + return null; }, [activeStakingProgram, defaultStakingProgram, stakingProgram]); // Show funding address @@ -239,16 +239,14 @@ export const StakingContractSection = ({ activeStakingContractSupportsMigration && !hasEnoughOlasToMigrate; - const cardStyle = useMemo(() => { - if (isSelected || !activeStakingProgram) { - return { background: token.colorPrimaryBg }; - } - return {}; - }, [isSelected, activeStakingProgram, token.colorPrimaryBg]); - return ( <> - + {`${stakingProgramMeta?.name} contract`} diff --git a/frontend/components/ManageStakingPage/index.tsx b/frontend/components/ManageStakingPage/index.tsx index 7eed430cd..544aad4e4 100644 --- a/frontend/components/ManageStakingPage/index.tsx +++ b/frontend/components/ManageStakingPage/index.tsx @@ -51,7 +51,10 @@ export const ManageStakingPage = () => { } > <WhatAreStakingContractsSection /> - <StakingContractSection stakingProgram={orderedStakingPrograms[0]} /> + + {activeStakingProgram && ( + <StakingContractSection stakingProgram={orderedStakingPrograms[0]} /> + )} <CardSection borderbottom="true" vertical gap={16}> {`Browse ${otherStakingPrograms.length} staking contract${otherStakingPrograms.length > 1 ? 's' : ''}.`}