Skip to content

Commit

Permalink
Merge pull request #965 from IntersectMBO/904-no-option-to-delegate-t…
Browse files Browse the repository at this point in the history
…o-myself-as-a-drep-after-delegating-to-abstain

[#904] No option to delegate to myself as a drep
  • Loading branch information
JanJaroszczak committed May 9, 2024
2 parents 1bfd6d8 + be9e1dd commit 6c01a1e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions govtool/frontend/src/components/organisms/DRepCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export const DRepCard = ({
}}
>
<Box minWidth={0} display="flex" flexDirection="column">
<Typography sx={ellipsisStyles}>{type}</Typography>
<Typography sx={ellipsisStyles}>
{type === "SoleVoter" ? t("dRepDirectory.directVoter") : type}
</Typography>
<ButtonBase
data-testid={`${view}-copy-id-button`}
onClick={(e) => {
Expand Down Expand Up @@ -178,7 +180,6 @@ export const DRepCard = ({
{status === "Active" &&
isConnected &&
onDelegate &&
!isMe &&
!isInProgress && (
<Button
data-testid={`${view}-delegate-button`}
Expand Down
3 changes: 3 additions & 0 deletions govtool/frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,13 @@ export const en = {
automatedVotingOptions: "Automated Voting Options",
editBtn: "Edit DRep data",
delegationOptions: "Delegation Options",
directVoter: "Direct Voter",
filterTitle: "DRep Status",
goToDRepDirectory: "Go to DRep Directory",
meAsDRep: "This DRep ID is connected to your wallet",
myDelegation: "You have delegated <strong>₳ {{ada}}</strong> to:",
myDelegationToYourself:
"You have delegated <strong>₳ {{ada}}</strong> to yourself:",
myDRep: "This is your DRep",
listTitle: "Find a DRep",
noConfidenceDescription:
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/models/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface DRepData {
deposit: number;
votingPower: number;
status: DRepStatus;
type: "DRep" | "DirectVoter";
type: "DRep" | "SoleVoter";
}
export type InfinityDRepData = {
elements: DRepData[];
Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
dRep={myDrep}
isConnected={!!isConnected}
isInProgress={isSameDRep(myDrep, inProgressDelegation)}
isMe={isSameDRep(myDrep, myDRepId)}
/>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/utils/tests/dRep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isSameDRep } from "..";

import { DRepStatus } from "@/models";

type TDRepType = "DRep" | "DirectVoter";
type TDRepType = "DRep" | "SoleVoter";

const EXAMPLE_DREP = {
drepId: "drep123",
Expand Down

0 comments on commit 6c01a1e

Please sign in to comment.