Skip to content

Commit

Permalink
fix StakingContractTag
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Sep 11, 2024
1 parent ee8d5f1 commit c0e3e00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StakingProgramStatus } from '@/enums/StakingProgramStatus';
export const StakingContractTag = ({
status,
}: {
status?: StakingProgramStatus;
status: StakingProgramStatus | null;
}) => {
if (status === StakingProgramStatus.Selected) {
return <Tag color="purple">Active</Tag>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,10 @@ export const StakingContractSection = ({
]);

const contractTagStatus = useMemo(() => {
if (activeStakingProgram === stakingProgram)
return StakingProgramStatus.Selected;

// not staked, set the default as the Selected contract
if (stakingProgram === defaultStakingProgram)
return StakingProgramStatus.Selected;

// otherwise, no tag
return;
}, [activeStakingProgram, defaultStakingProgram, stakingProgram]);
return activeStakingProgram === stakingProgram
? StakingProgramStatus.Selected
: null;
}, [activeStakingProgram, stakingProgram]);

// Show funding address
const canShowFundingAddress =
Expand Down

0 comments on commit c0e3e00

Please sign in to comment.