From 636c79443af9510061c1cced0099e70c087e47de Mon Sep 17 00:00:00 2001 From: saml33 Date: Mon, 25 Jul 2022 11:47:12 +1000 Subject: [PATCH] position icon menu panel --- components/TokenList.tsx | 2 ++ components/shared/IconDropMenu.tsx | 32 ++++++++++++++++++++++++++---- components/swap/SwapTokenChart.tsx | 8 ++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/components/TokenList.tsx b/components/TokenList.tsx index b029ade7..1acc80f7 100644 --- a/components/TokenList.tsx +++ b/components/TokenList.tsx @@ -134,6 +134,8 @@ const TokenList = () => {
} + postion="leftBottom" + disabled={!mangoAccount} > { + const panelPosition = { + bottomLeft: large ? 'left-0 top-14' : 'left-0 top-12', + bottomRight: large ? 'right-0 top-14' : 'right-0 top-12', + topLeft: large ? 'left-0 bottom-14' : 'left-0 bottom-12', + topRight: large ? 'right-0 bottom-14' : 'right-0 bottom-12', + leftBottom: large ? 'right-14 bottom-0' : 'right-12 bottom-0', + leftTop: large ? 'right-14 top-0' : 'right-12 top-0', + rightBottom: large ? 'left-14 bottom-0' : 'left-12 bottom-0', + rightTop: large ? 'left-14 top-0' : 'left-12 top-0', + } + return ( {({ open }) => ( @@ -18,7 +41,10 @@ const IconDropMenu = ({ {open ? : icon} @@ -34,9 +60,7 @@ const IconDropMenu = ({ leaveTo="opacity-0" > {children} diff --git a/components/swap/SwapTokenChart.tsx b/components/swap/SwapTokenChart.tsx index d967c613..e9f62c30 100644 --- a/components/swap/SwapTokenChart.tsx +++ b/components/swap/SwapTokenChart.tsx @@ -180,7 +180,7 @@ const SwapTokenChart: FunctionComponent = ({ ) : null} {mouseData ? ( <> -
+
= ({
-

+

{dayjs(mouseData['time']).format('DD MMM YY, h:mma')}

) : ( <> -
+
= ({
-

+

{dayjs(chartData[chartData.length - 1]['time']).format( 'DD MMM YY, h:mma' )}