From 0fc9ca87613180ed50e862ebb0c771153c2197cd Mon Sep 17 00:00:00 2001 From: ikprk <168457495+ikprk@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:13:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B0=20Show=20potential=20revenue=20on?= =?UTF-8?q?=20revenue=20share=20(#6331)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RevenueShareWidget/RevenueShareWidget.tsx | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/atlas/src/components/_crt/RevenueShareWidget/RevenueShareWidget.tsx b/packages/atlas/src/components/_crt/RevenueShareWidget/RevenueShareWidget.tsx index cafea0f578..56ca34d924 100644 --- a/packages/atlas/src/components/_crt/RevenueShareWidget/RevenueShareWidget.tsx +++ b/packages/atlas/src/components/_crt/RevenueShareWidget/RevenueShareWidget.tsx @@ -5,6 +5,7 @@ import { GetTokenRevenueSharesQuery, useGetCreatorTokenHoldersQuery, useGetFullCreatorTokenQuery, + useGetRevenueShareDividendQuery, } from '@/api/queries/__generated__/creatorTokens.generated' import { SvgActionCalendar, SvgActionLock, SvgJoyTokenMonochrome16 } from '@/assets/icons' import { Avatar } from '@/components/Avatar' @@ -45,6 +46,13 @@ export const RevenueShareWidget = ({ tokenName, tokenId, revenueShare, memberId }, }, }) + const { data: dividendData, loading: loadingDividendData } = useGetRevenueShareDividendQuery({ + variables: { + tokenId: tokenId, + stakingAmount: +(holderData?.tokenAccounts[0]?.totalAmount ?? 0), + }, + skip: !holderData?.tokenAccounts[0] || !tokenId, + }) const status = getRevenueShareStatusForMember({ currentBlock, endingAt: revenueShare.endsAt, @@ -119,13 +127,17 @@ export const RevenueShareWidget = ({ tokenName, tokenId, revenueShare, memberId - } - /> + {loadingDividendData ? ( + + ) : ( + } + /> + )}