Skip to content

Commit

Permalink
feat: add tooltip to MyBonds - OLAS payout column
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Aug 22, 2024
1 parent 6cf8d7d commit b7ac697
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions apps/bond/components/MyBonds/MyBonds.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
import { Button, ConfigProvider, Empty, Radio, Table, Typography } from 'antd';
import { Button, ConfigProvider, Empty, Radio, Table, Tooltip, Typography } from 'antd';
import { round } from 'lodash';
import { useEffect, useState } from 'react';
import { useCallback, useEffect, useState } from 'react';

import { getFormattedDate, notifyError, notifySuccess } from '@autonolas/frontend-library';

Expand All @@ -20,7 +20,14 @@ const getBondsColumns = () => {
title: 'Payout in OLAS',
dataIndex: 'payout',
key: 'payout',
render: (value) => `${round(parseToEth(value), 4)}`,
render: (value) => {
const parseValue = `${parseToEth(value)}`;
return (
<Tooltip title={parseValue} placement="right">
{round(parseValue, 4)}
</Tooltip>
);
},
},
{
title: 'Matured?',
Expand Down Expand Up @@ -57,7 +64,7 @@ export const MyBonds = () => {
const [nonMaturedBondList, setNonMaturedBondList] = useState([]);
const [selectedBondIds, setSelectedBondIds] = useState([]);

const getBondsListHelper = async () => {
const getBondsListHelper = useCallback(async () => {
try {
setIsLoading(true);

Expand All @@ -71,7 +78,7 @@ export const MyBonds = () => {
} finally {
setIsLoading(false);
}
};
}, [account]);

// on load, get the list of bonds & set the maturity type radio button
useEffect(() => {
Expand Down Expand Up @@ -103,7 +110,7 @@ export const MyBonds = () => {
if (account && chainId) {
getBondsListHelper();
}
}, [account, chainId, maturityType]);
}, [account, chainId, maturityType, getBondsListHelper]);

const onRedeem = async () => {
try {
Expand Down

0 comments on commit b7ac697

Please sign in to comment.