Skip to content

Commit

Permalink
Merge pull request #47 from cryptoalgebra/hotfix/pools-table-avgAPR
Browse files Browse the repository at this point in the history
hotfix/pools-table-avgAPR
  • Loading branch information
lilchizh authored May 23, 2024
2 parents 434e4dc + a717ff0 commit 962e88e
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/components/common/Table/poolsColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ const Plugins = ({ poolId }: { poolId: Address }) => {
);
};

const AvgAPR = ({ children, avgApr, farmApr, maxApr }: { children: ReactNode; avgApr: string; farmApr: string | undefined; maxApr: string }) => {
const AvgAPR = ({
children,
avgApr,
farmApr,
maxApr,
}: {
children: ReactNode;
avgApr: string;
farmApr: string | undefined;
maxApr: string;
}) => {
return (
<HoverCard>
<HoverCardTrigger>{children}</HoverCardTrigger>
Expand Down Expand Up @@ -135,11 +145,11 @@ export const poolsColumns: ColumnDef<Pool>[] = [
cell: ({ getValue, row }) => {
return (
<AvgAPR
avgApr={formatPercent.format(row.original.poolAvgApr)}
maxApr={formatPercent.format(row.original.poolMaxApr)}
farmApr={row.original.hasActiveFarming ? formatPercent.format(row.original.farmApr) : undefined}
avgApr={formatPercent.format(row.original.poolAvgApr / 100)}
maxApr={formatPercent.format(row.original.poolMaxApr / 100)}
farmApr={row.original.hasActiveFarming ? formatPercent.format(row.original.farmApr / 100) : undefined}
>
{formatPercent.format(getValue() as number)}
{formatPercent.format((getValue() as number) / 100)}
</AvgAPR>
);
},
Expand Down

0 comments on commit 962e88e

Please sign in to comment.