diff --git a/src/domains/vote/components/DelegateTable/DelegateRow/DelegateRow.tsx b/src/domains/vote/components/DelegateTable/DelegateRow/DelegateRow.tsx index 37dce66a35..10c2ae42d9 100755 --- a/src/domains/vote/components/DelegateTable/DelegateRow/DelegateRow.tsx +++ b/src/domains/vote/components/DelegateTable/DelegateRow/DelegateRow.tsx @@ -3,6 +3,7 @@ import cn from "classnames"; import React, { useMemo } from "react"; import { useTranslation } from "react-i18next"; +import { useResizeDetector } from "react-resize-detector"; import { DelegateRowSkeleton } from "./DelegateRowSkeleton"; import { DelegateVoteAmount } from "./DelegateVoteAmount"; import { DelegateVoteButton } from "./DelegateVoteButton"; @@ -13,6 +14,7 @@ import { TableCell, TableRow } from "@/app/components/Table"; import { VoteDelegateProperties } from "@/domains/vote/components/DelegateTable/DelegateTable.contracts"; import { delegateExistsInVotes } from "@/domains/vote/components/DelegateTable/DelegateTable.helpers"; import { Tooltip } from "@/app/components/Tooltip"; +import { TruncateMiddleDynamic } from "@/app/components/TruncateMiddleDynamic"; interface DelegateRowProperties { index: number; @@ -83,6 +85,8 @@ export const DelegateRow = ({ return !!voted && (alreadyExistsInVotes || alreadyExistsInUnvotes); }, [selectedVotes, selectedUnvotes, isSelectedUnvote, voted, delegate]); + const { ref, width } = useResizeDetector({ handleHeight: false }); + const rowColor = useMemo(() => { if (isChanged) { return "bg-theme-warning-50 dark:bg-theme-background dark:border-theme-warning-600"; @@ -194,7 +198,7 @@ export const DelegateRow = ({ isCompact={isCompact} innerClassName={cn("font-bold border-2 border-r-0 border-transparent", rowColor, { "h-12": isCompact })} > - {delegate.rank()} + {delegate.rank() ?? '0'} -
- -
{delegate.username()}
+
+ + {delegate.username() ? ( +
{delegate.username()}
+ ): ( + + )} +