Skip to content

Commit

Permalink
fix: MET-1647 truncate top ada holder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TrungHoang committed Oct 23, 2023
1 parent 0b6539e commit 4f64363
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
16 changes: 7 additions & 9 deletions src/components/TopAddresses/ByADABalance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { SelectChangeEvent } from "@mui/material/Select/SelectInput";
import useFetchList from "src/commons/hooks/useFetchList";
import { details } from "src/commons/routers";
import { API } from "src/commons/utils/api";
import { formatADAFull, getShortHash, numberWithCommas } from "src/commons/utils/helper";
import { formatADAFull, numberWithCommas } from "src/commons/utils/helper";
import ADAicon from "src/components/commons/ADAIcon";
import CustomTooltip from "src/components/commons/CustomTooltip";
import FormNowMessage from "src/components/commons/FormNowMessage";
import Table, { Column } from "src/components/commons/Table";
import DynamicEllipsisText from "src/components/DynamicEllipsisText";

import { Actions, PageSize, PerPage, SelectMui, StyledLink, StyledMenuItem, TimeDuration } from "./styles";

Expand All @@ -34,14 +34,12 @@ const TopAddressesByADABalance = () => {
{
title: t("glossary.address"),
key: "address",
minWidth: 120,

minWidth: 170,
maxWidth: "35vw",
render: (r) => (
<div>
<CustomTooltip title={r.address}>
<StyledLink to={details.address(r.address)}>{getShortHash(r.address)}</StyledLink>
</CustomTooltip>
</div>
<StyledLink to={details.address(r.address)}>
<DynamicEllipsisText value={r.address} isTooltip />
</StyledLink>
)
},
{
Expand Down
34 changes: 23 additions & 11 deletions src/components/TopAddresses/ByAmountStaked/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { useSelector } from "react-redux";
import useFetchList from "src/commons/hooks/useFetchList";
import { details } from "src/commons/routers";
import { API } from "src/commons/utils/api";
import { formatADAFull, getShortHash } from "src/commons/utils/helper";
import { formatADAFull } from "src/commons/utils/helper";
import ADAicon from "src/components/commons/ADAIcon";
import CustomTooltip from "src/components/commons/CustomTooltip";
import FormNowMessage from "src/components/commons/FormNowMessage";
import Table from "src/components/commons/Table";
import { Column } from "src/types/table";
import DynamicEllipsisText from "src/components/DynamicEllipsisText";

import { Actions, PageSize, PerPage, SelectMui, StyledLink, StyledMenuItem, TimeDuration } from "./styles";

Expand All @@ -33,23 +34,34 @@ const TopAddressesByAmountStaked = () => {
const columns: Column<TopDelegator>[] = [
{
title: t("common.stakeAddress"),
minWidth: 200,
minWidth: 170,
key: "addresses",
maxWidth: "30vw",
render: (r) => (
<CustomTooltip title={r.stakeKey}>
<StyledLink to={details.stake(r.stakeKey)}>{getShortHash(r.stakeKey)}</StyledLink>
</CustomTooltip>
<StyledLink to={details.address(r.stakeKey)}>
<DynamicEllipsisText value={r.stakeKey} isTooltip />
</StyledLink>
)
},
{
title: t("glossary.pool"),
key: "pool",
maxWidth: 300,
render: (r) => (
<CustomTooltip title={r.poolName || r.poolId}>
<StyledLink to={details.delegation(r.poolId)}>{r.poolName || getShortHash(r.poolId)}</StyledLink>
</CustomTooltip>
)
minWidth: 170,
maxWidth: "30vw",
render: (r) => {
if (r.poolName) {
return (
<CustomTooltip title={r.poolName}>
<StyledLink to={details.delegation(r.poolId)}>{r.poolName}</StyledLink>
</CustomTooltip>
);
}
return (
<StyledLink to={details.address(r.stakeKey)}>
<DynamicEllipsisText value={r.stakeKey} isTooltip />
</StyledLink>
);
}
},
{
title: t("stakeAmount"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ export const ValueItemMultiple = styled(Box)(({ theme }) => ({
display: "flex",
width: "80%",
[theme.breakpoints.up("sm")]: {
width: "100%%"
width: "100%"
}
}));

0 comments on commit 4f64363

Please sign in to comment.