From e1dd3980b8e7d935eeecb23b409e7b8fc5dea8b0 Mon Sep 17 00:00:00 2001 From: saml33 Date: Wed, 21 Apr 2021 22:45:03 +1000 Subject: [PATCH] hide settle button and small styling updates --- components/BalancesTable.tsx | 29 +++++++++++++++++++++++------ components/MarginBalances.tsx | 30 ++++++++++++++++-------------- components/MarketSelect.tsx | 6 ++++-- components/Tooltip.tsx | 2 +- components/TradeForm.tsx | 3 +++ components/WalletSelect.tsx | 2 +- 6 files changed, 48 insertions(+), 24 deletions(-) diff --git a/components/BalancesTable.tsx b/components/BalancesTable.tsx index a14f802..4505262 100644 --- a/components/BalancesTable.tsx +++ b/components/BalancesTable.tsx @@ -6,6 +6,9 @@ import Button from '../components/Button' import { notify } from '../utils/notifications' import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table' import useMarket from '../hooks/useMarket' +import { ElementTitle } from './styles' +import { InformationCircleIcon } from '@heroicons/react/outline' +import Tooltip from './Tooltip' const BalancesTable = () => { const balances = useBalances() @@ -52,15 +55,29 @@ const BalancesTable = () => {
- {/* balances.length && balances.find((balance) => balance.unsettled > 0) */} - {balances.length ? ( + +
{marketName.split('/')[0]}
+ / +
{marketName.split('/')[1]}
+
+ {balances.length && + (balances.find(({ unsettled }) => unsettled > 0) || + balances.find( + ({ borrows, marginDeposits }) => borrows > 0 && marginDeposits > 0 + )) ? (
-
Balances for {marketName}
- {/*
- You have an unsettled balance -
*/} +
+ You have unsettled funds + +
+ +
+
+
) : null} diff --git a/components/MarginBalances.tsx b/components/MarginBalances.tsx index 0fde179..ac1831d 100644 --- a/components/MarginBalances.tsx +++ b/components/MarginBalances.tsx @@ -156,37 +156,39 @@ const AddressTooltip = ({ <> {owner && marginAccount ? ( <> -
+
Margin Account: - -
+
Account Owner: - diff --git a/components/MarketSelect.tsx b/components/MarketSelect.tsx index 66b065e..4c8c791 100644 --- a/components/MarketSelect.tsx +++ b/components/MarketSelect.tsx @@ -18,7 +18,7 @@ const MarketSelect = () => { {/*
MARKETS
*/} {Object.entries(spotMarkets).map(([name, address]) => (
{ onClick={() => handleChange(name)} key={address as string} > - {name} +
{name.split('/')[0]}
+ / +
{name.split('/')[1]}
))}
diff --git a/components/Tooltip.tsx b/components/Tooltip.tsx index b36f256..9f192f8 100644 --- a/components/Tooltip.tsx +++ b/components/Tooltip.tsx @@ -11,7 +11,7 @@ const Tooltip: FunctionComponent = ({ children, content }) => { document.body} - maxWidth="none" + maxWidth="30rem" interactive content={
diff --git a/components/TradeForm.tsx b/components/TradeForm.tsx index edd40b3..183d941 100644 --- a/components/TradeForm.tsx +++ b/components/TradeForm.tsx @@ -331,6 +331,9 @@ export default function TradeForm() { ) ) : ( <> + {/*