From 9c311a4bc64e5b5a958571313302c700287b11e2 Mon Sep 17 00:00:00 2001 From: tadejpodrekar Date: Tue, 7 Jan 2025 15:01:03 +0100 Subject: [PATCH 1/2] fix: remove markets nav on mobile --- apps/frontend/src/components/Navbar/index.tsx | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/apps/frontend/src/components/Navbar/index.tsx b/apps/frontend/src/components/Navbar/index.tsx index 8dd10c34..658bdfb3 100644 --- a/apps/frontend/src/components/Navbar/index.tsx +++ b/apps/frontend/src/components/Navbar/index.tsx @@ -278,24 +278,29 @@ export const Navbar = ({ mobile = false }: { mobile?: boolean }) => { Dashboard - {NAVBAR_LINKS.map(({ href, label }) => ( - setOpen(false)} - prefetch={false} - > -
{ + if (mobile && href === '/markets') return null; + return ( + setOpen(false)} + prefetch={false} > - {label} -
- - ))} +
+ {label} +
+ + ); + })} From 9c121bbb37f3bd89135cc3099c837c33cad735d6 Mon Sep 17 00:00:00 2001 From: tadejpodrekar Date: Tue, 7 Jan 2025 15:02:24 +0100 Subject: [PATCH 2/2] fix: collateral info supply format --- .../DashboardView/AssetsTable/CollateralTable.tsx | 10 ++++++---- apps/frontend/src/utils/price.ts | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/frontend/src/components/DashboardView/AssetsTable/CollateralTable.tsx b/apps/frontend/src/components/DashboardView/AssetsTable/CollateralTable.tsx index dfeaf28f..e8379f77 100644 --- a/apps/frontend/src/components/DashboardView/AssetsTable/CollateralTable.tsx +++ b/apps/frontend/src/components/DashboardView/AssetsTable/CollateralTable.tsx @@ -139,7 +139,8 @@ const CollateralTableRow = ({ collateralConfiguration.supply_cap.toString() ), decimals - ) + ), + 2 )}{' '} {appConfig.assets[assetId]} @@ -147,7 +148,7 @@ const CollateralTableRow = ({
Total Supplied
- {getFormattedNumber(collateralAmount)}{' '} + {getFormattedNumber(collateralAmount, 2)}{' '} {appConfig.assets[assetId]}
@@ -229,7 +230,8 @@ const CollateralTableRow = ({ collateralConfiguration.supply_cap.toString() ), decimals - ) + ), + 2 )}{' '} {appConfig.assets[assetId]} @@ -251,7 +253,7 @@ const CollateralTableRow = ({
Total Supplied
- {getFormattedNumber(collateralAmount)}{' '} + {getFormattedNumber(collateralAmount, 2)}{' '} {appConfig.assets[assetId]}
diff --git a/apps/frontend/src/utils/price.ts b/apps/frontend/src/utils/price.ts index 22d57a2f..0e275666 100644 --- a/apps/frontend/src/utils/price.ts +++ b/apps/frontend/src/utils/price.ts @@ -17,6 +17,7 @@ export const getFormattedPrice = (number: BigNumber): string => { export const getFormattedNumber = ( number: BigNumber, + decimals = 4, positive?: boolean ): string => { if (!number || number.isNaN() || number.eq(0)) return '0.0'; @@ -35,5 +36,5 @@ export const getFormattedNumber = ( return '0.0'; } - return `${number.toFixed(4, BigNumber.ROUND_FLOOR)}`; + return `${number.toFixed(decimals, BigNumber.ROUND_FLOOR)}`; };