From 9a99e6f1ff99a8991483c26cb6a859289c2e3948 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 10 Apr 2023 10:21:27 -0700 Subject: [PATCH] Fix hide currency column in book when mode is swaps --- frontend/src/components/BookTable/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/BookTable/index.tsx b/frontend/src/components/BookTable/index.tsx index 3a2ae0d9..ac05b188 100644 --- a/frontend/src/components/BookTable/index.tsx +++ b/frontend/src/components/BookTable/index.tsx @@ -249,9 +249,8 @@ const BookTable = ({ }; }; - const currencyObj = function (width: number, hide: boolean) { + const currencyObj = function (width: number) { return { - hide: fav.mode === 'swap' ? true : hide, field: 'currency', headerName: t('Currency'), width: width * fontSize, @@ -602,6 +601,11 @@ const BookTable = ({ let width: number = 0; for (const [key, value] of Object.entries(columnSpecs)) { + // do not use col currency on swaps + if (fav.mode === 'swap' && key === 'currency') { + continue; + } + const colWidth = useSmall && value.small ? value.small.width : value.normal.width; const colObject = useSmall && value.small ? value.small.object : value.normal.object; @@ -630,7 +634,7 @@ const BookTable = ({ const [columns, width] = useMemo(() => { return filteredColumns(fullscreen ? fullWidth : maxWidth); - }, [maxWidth, fullscreen, fullWidth]); + }, [maxWidth, fullscreen, fullWidth, fav.mode]); const Footer = function () { return (