From b1b3b2690136a2a87e0b350336cc5dce6f8c6b02 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 11:16:46 +0200 Subject: [PATCH 01/13] Add fee tier keys/descriptions --- public/locales/en/translations.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 445a2e351..62c0d874d 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -625,6 +625,8 @@ "fees": { "title": "Account Fees", "sub_title": "Based on your trading volume", + "fee_tier_volume_main": "Volume in the last 30 days", + "fee_tier_volume_secondary": "(Eligible for fee tier calculation)", "maker": "Maker Fees", "taker_crypto": "Taker Fees Crypto", "taker_fiat": "Taker Fees Fiat", From 85251ee1b3e9880daf363411abb8a279bc8b7211 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 11:32:15 +0200 Subject: [PATCH 02/13] Implement getFeeTierVolume helper --- src/components/AppSummary/AppSummary.helpers.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/AppSummary/AppSummary.helpers.js b/src/components/AppSummary/AppSummary.helpers.js index d024225fc..bdbead617 100644 --- a/src/components/AppSummary/AppSummary.helpers.js +++ b/src/components/AppSummary/AppSummary.helpers.js @@ -33,3 +33,5 @@ export const shouldShowPercentCheck = (balance, balanceChange) => { if (bal === balChange) return false return true } + +export const getFeeTierVolume = (data) => data?.trade_vol_30d?.at(-1)?.vol_safe ?? 0 From f1c80f0164131d077025683cdcfebb050768faee Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 11:40:26 +0200 Subject: [PATCH 03/13] Provide fee tier vol to app summary fees --- src/components/AppSummary/AppSummary.fees.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/AppSummary/AppSummary.fees.js b/src/components/AppSummary/AppSummary.fees.js index 271ca71f9..225575e59 100644 --- a/src/components/AppSummary/AppSummary.fees.js +++ b/src/components/AppSummary/AppSummary.fees.js @@ -1,4 +1,4 @@ -import React, { memo } from 'react' +import React, { memo, useMemo } from 'react' import PropTypes from 'prop-types' import { isEmpty } from '@bitfinex/lib-js-util-base' @@ -7,6 +7,7 @@ import Loading from 'ui/Loading' import CollapsedTable from 'ui/CollapsedTable' import { getFeesColumns } from './AppSummary.columns' +import { getFeeTierVolume } from './AppSummary.helpers' const AppSummaryFees = ({ t, @@ -24,8 +25,14 @@ const AppSummaryFees = ({ derivMakerRebate = 0, } = data + const feeTierVolume = useMemo( + () => getFeeTierVolume(data), + [data], + ) + const columns = getFeesColumns({ makerFee, + feeTierVolume, isTurkishSite, derivTakerFee, takerFeeToFiat, From c1d45f483285b9a5902cc13c6b971bb316512202 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 11:45:52 +0200 Subject: [PATCH 04/13] Add fee tier column configuration --- src/components/AppSummary/AppSummary.columns.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/AppSummary/AppSummary.columns.js b/src/components/AppSummary/AppSummary.columns.js index bff710d41..766ab4d77 100644 --- a/src/components/AppSummary/AppSummary.columns.js +++ b/src/components/AppSummary/AppSummary.columns.js @@ -13,6 +13,7 @@ import { export const getFeesColumns = ({ makerFee, + feeTierVolume, isTurkishSite, derivTakerFee, takerFeeToFiat, @@ -20,6 +21,17 @@ export const getFeesColumns = ({ takerFeeToCrypto, derivMakerRebate, }) => [ + { + id: 'feeTierVolume', + name: 'summary.fees.fee_tier_volume_main', + width: 100, + renderer: () => ( + + $ + {formatUsdValue(feeTierVolume)} + + ), + }, { id: 'makerFee', name: 'summary.fees.maker', From ccb6176d2fdebb435191724c6f16b2cff438e169 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:10:50 +0200 Subject: [PATCH 05/13] Implement description support in the collapsed tables --- src/ui/CollapsedTable/CollapsedTable.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/CollapsedTable/CollapsedTable.js b/src/ui/CollapsedTable/CollapsedTable.js index 9adf600f3..ba802c53b 100644 --- a/src/ui/CollapsedTable/CollapsedTable.js +++ b/src/ui/CollapsedTable/CollapsedTable.js @@ -13,13 +13,16 @@ class CollapsedTable extends PureComponent {
{tableColumns.map((column) => { const { - id, name, nameStr, renderer, + id, name, nameStr, renderer, description, } = column const cell = renderer(rowIndex) - return (
-
{nameStr || t(name)}
+
+ {nameStr || t(name)} +
+ {description && t(description)} +
{cell.props.children}
) From 8f346592af70e103fd277ba75a25b5c62d2e469a Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:12:44 +0200 Subject: [PATCH 06/13] Adjust acc fees cols sizing --- src/components/AppSummary/_AppSummary.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AppSummary/_AppSummary.scss b/src/components/AppSummary/_AppSummary.scss index 8f65174f5..9f41b1e4c 100644 --- a/src/components/AppSummary/_AppSummary.scss +++ b/src/components/AppSummary/_AppSummary.scss @@ -86,7 +86,7 @@ border-bottom: 1px solid var(--tableBorder); &:first-child { - width: 45%; + width: 50%; } &:last-child { From f785cbe1db7b8ee94e72e59428b02be999c22665 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:19:51 +0200 Subject: [PATCH 07/13] Update cell description styling --- src/components/AppSummary/_AppSummary.scss | 4 ++++ src/ui/CollapsedTable/CollapsedTable.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/AppSummary/_AppSummary.scss b/src/components/AppSummary/_AppSummary.scss index 9f41b1e4c..611ca3b25 100644 --- a/src/components/AppSummary/_AppSummary.scss +++ b/src/components/AppSummary/_AppSummary.scss @@ -94,6 +94,10 @@ text-align: end; word-break: break-word; } + + .cell-description { + font-size: 14px; + } } &:last-child { diff --git a/src/ui/CollapsedTable/CollapsedTable.js b/src/ui/CollapsedTable/CollapsedTable.js index ba802c53b..0787a7f88 100644 --- a/src/ui/CollapsedTable/CollapsedTable.js +++ b/src/ui/CollapsedTable/CollapsedTable.js @@ -21,7 +21,11 @@ class CollapsedTable extends PureComponent {
{nameStr || t(name)}
- {description && t(description)} + {description && ( + + {t(description)} + + )}
{cell.props.children}
From 48bb72239ecfb44f51388b67ee3615532b7d7c94 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:20:37 +0200 Subject: [PATCH 08/13] Lint fix --- src/ui/CollapsedTable/CollapsedTable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/CollapsedTable/CollapsedTable.js b/src/ui/CollapsedTable/CollapsedTable.js index 0787a7f88..0b09b6f4a 100644 --- a/src/ui/CollapsedTable/CollapsedTable.js +++ b/src/ui/CollapsedTable/CollapsedTable.js @@ -22,9 +22,9 @@ class CollapsedTable extends PureComponent { {nameStr || t(name)}
{description && ( - - {t(description)} - + + {t(description)} + )}
{cell.props.children}
From fc67cede6683d7aa4dc9dee33c55a7256bf6f85e Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:21:04 +0200 Subject: [PATCH 09/13] Add fee tier description --- src/components/AppSummary/AppSummary.columns.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/AppSummary/AppSummary.columns.js b/src/components/AppSummary/AppSummary.columns.js index 766ab4d77..81777a21e 100644 --- a/src/components/AppSummary/AppSummary.columns.js +++ b/src/components/AppSummary/AppSummary.columns.js @@ -24,6 +24,7 @@ export const getFeesColumns = ({ { id: 'feeTierVolume', name: 'summary.fees.fee_tier_volume_main', + description: 'summary.fees.fee_tier_volume_secondary', width: 100, renderer: () => ( From a3d4073cbe79592e21a9bc445f43c5a06b384be9 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 12:25:16 +0200 Subject: [PATCH 10/13] Adjust chart aspect --- src/components/AppSummary/AppSummary.value.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AppSummary/AppSummary.value.js b/src/components/AppSummary/AppSummary.value.js index 3b7994c2c..d6d921e96 100644 --- a/src/components/AppSummary/AppSummary.value.js +++ b/src/components/AppSummary/AppSummary.value.js @@ -71,7 +71,7 @@ const AccountSummaryValue = () => { {formattedPercValue} Date: Mon, 11 Dec 2023 16:34:52 +0200 Subject: [PATCH 11/13] Update account fees keys/descriptions --- public/locales/en/translations.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 62c0d874d..f465119da 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -624,9 +624,8 @@ "no_data": "No related data for this period is available or data should be synced.", "fees": { "title": "Account Fees", - "sub_title": "Based on your trading volume", - "fee_tier_volume_main": "Volume in the last 30 days", - "fee_tier_volume_secondary": "(Eligible for fee tier calculation)", + "sub_title": "Based on your 30 days eligible trading volume", + "fee_tier_volume": "Eligible Trading Volume", "maker": "Maker Fees", "taker_crypto": "Taker Fees Crypto", "taker_fiat": "Taker Fees Fiat", From f02f3281b937e214991a7b76401a69826dbed604 Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 16:35:23 +0200 Subject: [PATCH 12/13] Actualize feeTierVolume cell config --- src/components/AppSummary/AppSummary.columns.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/AppSummary/AppSummary.columns.js b/src/components/AppSummary/AppSummary.columns.js index 81777a21e..11a27bf70 100644 --- a/src/components/AppSummary/AppSummary.columns.js +++ b/src/components/AppSummary/AppSummary.columns.js @@ -23,8 +23,7 @@ export const getFeesColumns = ({ }) => [ { id: 'feeTierVolume', - name: 'summary.fees.fee_tier_volume_main', - description: 'summary.fees.fee_tier_volume_secondary', + name: 'summary.fees.fee_tier_volume', width: 100, renderer: () => ( From 31875f69425bb4e26c056c9ec2456284a72b1b6e Mon Sep 17 00:00:00 2001 From: alexstotsky Date: Mon, 11 Dec 2023 16:38:04 +0200 Subject: [PATCH 13/13] Actualize chart aspect --- src/components/AppSummary/AppSummary.value.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AppSummary/AppSummary.value.js b/src/components/AppSummary/AppSummary.value.js index d6d921e96..107bdc93f 100644 --- a/src/components/AppSummary/AppSummary.value.js +++ b/src/components/AppSummary/AppSummary.value.js @@ -71,7 +71,7 @@ const AccountSummaryValue = () => { {formattedPercValue}