From 6cfc397dd215031c541674294ae2b5581cff1c69 Mon Sep 17 00:00:00 2001 From: saml33 Date: Fri, 9 Sep 2022 11:00:47 +1000 Subject: [PATCH] fix loaders --- components/TradeHistoryTable.tsx | 8 ++--- components/account/AccountPage.tsx | 8 ++--- components/shared/DetailedAreaChart.tsx | 39 +++++-------------------- components/shared/SheenLoader.tsx | 8 ++++- components/swap/SwapForm.tsx | 4 +-- 5 files changed, 24 insertions(+), 43 deletions(-) diff --git a/components/TradeHistoryTable.tsx b/components/TradeHistoryTable.tsx index d1b118cf..20a9df6e 100644 --- a/components/TradeHistoryTable.tsx +++ b/components/TradeHistoryTable.tsx @@ -340,16 +340,16 @@ const TradeHistoryTable = ({ ) ) : (
- +
- +
- +
- +
diff --git a/components/account/AccountPage.tsx b/components/account/AccountPage.tsx index 14480693..668a1547 100644 --- a/components/account/AccountPage.tsx +++ b/components/account/AccountPage.tsx @@ -219,12 +219,12 @@ const AccountPage = () => {
-
-
+
+

{t('health')}

{maintHealth}%

-
+

{t('free-collateral')}

{mangoAccount @@ -253,7 +253,7 @@ const AccountPage = () => { ) : null}

*/} -
+

{t('total-interest-value')}

diff --git a/components/shared/DetailedAreaChart.tsx b/components/shared/DetailedAreaChart.tsx index 1efa5130..c58b40bb 100644 --- a/components/shared/DetailedAreaChart.tsx +++ b/components/shared/DetailedAreaChart.tsx @@ -21,6 +21,7 @@ import { IconButton } from './Button' import { ArrowLeftIcon } from '@heroicons/react/20/solid' import { FadeInFadeOut } from './Transitions' import ChartRangeButtons from './ChartRangeButtons' +import PercentageChange from './PercentageChange' dayjs.extend(relativeTime) @@ -91,8 +92,8 @@ const DetailedAreaChart: FunctionComponent = ({ {loading ? ( - -

+ +
) : data.length ? (
@@ -114,21 +115,8 @@ const DetailedAreaChart: FunctionComponent = ({ numbers={mouseData[yKey].toFixed(2)} /> {!hideChange ? ( - = 0 - ? 'text-th-green' - : 'text-th-red' - }`} - > - {calculateChartChange() >= 0 ? ( - - ) : ( - - )} - - {calculateChartChange().toFixed(2)}% - + + ) : null}
@@ -147,21 +135,8 @@ const DetailedAreaChart: FunctionComponent = ({ numbers={data[data.length - 1][yKey].toFixed(2)} /> {!hideChange ? ( - = 0 - ? 'text-th-green' - : 'text-th-red' - }`} - > - {calculateChartChange() >= 0 ? ( - - ) : ( - - )} - - {calculateChartChange().toFixed(2)}% - + + ) : null}
diff --git a/components/shared/SheenLoader.tsx b/components/shared/SheenLoader.tsx index 0ab712e6..938156d0 100644 --- a/components/shared/SheenLoader.tsx +++ b/components/shared/SheenLoader.tsx @@ -1,3 +1,4 @@ +import { useTheme } from 'next-themes' import { ReactNode } from 'react' // Children should be a shape or set of shapes with a bg color to animate over @@ -9,10 +10,15 @@ const SheenLoader = ({ children: ReactNode className?: string }) => { + const { theme } = useTheme() return (
{children}
diff --git a/components/swap/SwapForm.tsx b/components/swap/SwapForm.tsx index 90a9e09a..298630ac 100644 --- a/components/swap/SwapForm.tsx +++ b/components/swap/SwapForm.tsx @@ -317,8 +317,8 @@ const SwapForm = () => {
{isLoadingTradeDetails ? (
- -
+ +
) : (