From d174e07a09a60d17c1a53869cad0610b41181c97 Mon Sep 17 00:00:00 2001
From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com>
Date: Tue, 3 Sep 2024 18:06:53 -0700
Subject: [PATCH 1/3] [PAY-3410] Update 'Value' to be 'Total' and to show the
amount paid to artist
---
.../pay-and-earn-page/components/SalesTable.tsx | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
index cf449a1223e..65991e8e921 100644
--- a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
+++ b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
@@ -3,8 +3,7 @@ import { MouseEvent, useCallback, useMemo } from 'react'
import { useFeatureFlag } from '@audius/common/hooks'
import { USDCPurchaseDetails } from '@audius/common/models'
import { FeatureFlags } from '@audius/common/services'
-import { formatUSDCWeiToUSDString } from '@audius/common/utils'
-import { BN } from 'bn.js'
+import { USDC } from '@audius/fixed-decimal'
import moment from 'moment'
import { UserLink } from 'components/link'
@@ -70,8 +69,13 @@ const renderDateCell = (cellInfo: PurchaseCell) => {
const renderValueCell = (cellInfo: PurchaseCell) => {
const transaction = cellInfo.row.original
- const total = new BN(transaction.amount).add(new BN(transaction.extraAmount))
- return `$${formatUSDCWeiToUSDString(total)}`
+ const total = USDC(
+ BigInt(
+ transaction.splits.find((s) => s.userId === transaction.sellerUserId)
+ ?.amount || 0
+ )
+ ).toLocaleString()
+ return total
}
// Columns
@@ -105,7 +109,7 @@ const tableColumnMap = {
},
value: {
id: 'value',
- Header: 'Value',
+ Header: 'Total',
accessor: 'amount',
Cell: renderValueCell,
maxWidth: 200,
From 86197dd3d2b400aca5065f4420a0e6b035980e6d Mon Sep 17 00:00:00 2001
From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com>
Date: Tue, 3 Sep 2024 18:11:24 -0700
Subject: [PATCH 2/3] [PAY-3406] Update link and add to allowed domains
---
packages/common/src/utils/linking.ts | 3 ++-
.../src/pages/pay-and-earn-page/components/SalesTab.tsx | 9 +++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/packages/common/src/utils/linking.ts b/packages/common/src/utils/linking.ts
index c2b124b5dee..1ec21c7b720 100644
--- a/packages/common/src/utils/linking.ts
+++ b/packages/common/src/utils/linking.ts
@@ -8,7 +8,8 @@ export const externalLinkAllowList = new Set([
'link.audius.co',
'audius.co',
'discord.gg',
- 'solscan.io'
+ 'solscan.io',
+ 'help.audius.co'
])
export const isAllowedExternalLink = (link: string) => {
diff --git a/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx b/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx
index cb7c4207a0d..d718326d642 100644
--- a/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx
+++ b/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx
@@ -199,10 +199,11 @@ export const SalesTab = ({
{messages.networkSplitExplainer + ' '}
-
-
- {messages.learnMore}
-
+
+ {messages.learnMore}
From 08ddcf34b2ea065466836ee7228b452f05966a29 Mon Sep 17 00:00:00 2001
From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com>
Date: Tue, 3 Sep 2024 18:40:17 -0700
Subject: [PATCH 3/3] Forgot splits don't have payextra amount
---
.../web/src/pages/pay-and-earn-page/components/SalesTable.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
index 65991e8e921..188d2ce3c03 100644
--- a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
+++ b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx
@@ -73,7 +73,7 @@ const renderValueCell = (cellInfo: PurchaseCell) => {
BigInt(
transaction.splits.find((s) => s.userId === transaction.sellerUserId)
?.amount || 0
- )
+ ) + BigInt(transaction.extraAmount)
).toLocaleString()
return total
}