diff --git a/components/borrow/AssetsBorrowsTable.tsx b/components/borrow/AssetsBorrowsTable.tsx index 7c0f0b3a..9278d0fd 100644 --- a/components/borrow/AssetsBorrowsTable.tsx +++ b/components/borrow/AssetsBorrowsTable.tsx @@ -1,5 +1,6 @@ import { ArrowUpLeftIcon, + ChevronDownIcon, QuestionMarkCircleIcon, } from '@heroicons/react/20/solid' import { useTranslation } from 'next-i18next' @@ -8,7 +9,7 @@ import { useCallback, useEffect, useState } from 'react' import { useViewport } from '../../hooks/useViewport' import { formatNumericValue } from '../../utils/numbers' import { breakpoints } from '../../utils/theme' -import { IconButton } from '../shared/Button' +import Button, { IconButton } from '../shared/Button' import Tooltip from '@components/shared/Tooltip' import useJupiterMints from 'hooks/useJupiterMints' import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements' @@ -18,6 +19,7 @@ import BorrowRepayModal from '@components/modals/BorrowRepayModal' import BankAmountWithValue from '@components/shared/BankAmountWithValue' import useBanksWithBalances from 'hooks/useBanksWithBalances' import { getAvailableToBorrow } from './YourBorrowsTable' +import { Disclosure, Transition } from '@headlessui/react' const AssetsBorrowsTable = () => { const { t } = useTranslation(['common', 'token']) @@ -133,10 +135,10 @@ const AssetsBorrowsTable = () => { ) : ( -
+
{banks.map((b) => { const bank = b.bank - let logoURI + let logoURI: string | undefined if (mangoTokens?.length) { logoURI = mangoTokens.find( (t) => t.address === bank.mint.toString() @@ -146,47 +148,75 @@ const AssetsBorrowsTable = () => { const available = group ? getAvailableToBorrow(b, group) : 0 return ( -
-
-
-
- {logoURI ? ( - - ) : ( - - )} -
-

{bank.name}

-
-
-
-

- {t('available')} -

- 0 ? available : 0} - bank={bank} - /> -
-
-

{t('rate')}

-

- {formatNumericValue(bank.getBorrowRateUi(), 2)}% -

-
- handleShowBorrowModal(bank.name)} - size="medium" + + {({ open }) => ( + <> + - - -
-
-
+
+
+
+ {logoURI ? ( + + ) : ( + + )} +
+

{bank.name}

+
+
+
+

+ {t('rate')} +

+

+ {formatNumericValue(bank.getBorrowRateUi(), 2)}% +

+
+ +
+
+ + + +
+
+

+ {t('available')} +

+ 0 ? available : 0} + bank={bank} + /> +
+ +
+
+
+ + )} + ) })}