From 3de748a133b72da32001b5ecfd3eb35d46575789 Mon Sep 17 00:00:00 2001 From: Dexter Edwards Date: Tue, 16 Aug 2022 12:23:40 +0100 Subject: [PATCH] Revert "Revert "feat: show correct reward type (#930)"" (#969) This reverts commit 2a584e862c62ae19dde70bb0a8c55c72455064a1. --- apps/token/src/routes/rewards/home/__generated__/Rewards.ts | 6 ++++++ apps/token/src/routes/rewards/home/index.tsx | 1 + apps/token/src/routes/rewards/home/reward-info.tsx | 6 +----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/token/src/routes/rewards/home/__generated__/Rewards.ts b/apps/token/src/routes/rewards/home/__generated__/Rewards.ts index 0619f3bf8..765e911e3 100644 --- a/apps/token/src/routes/rewards/home/__generated__/Rewards.ts +++ b/apps/token/src/routes/rewards/home/__generated__/Rewards.ts @@ -3,6 +3,8 @@ // @generated // This file was automatically generated and should not be edited. +import { AccountType } from "@vegaprotocol/types"; + // ==================================================== // GraphQL query operation: Rewards // ==================================================== @@ -45,6 +47,10 @@ export interface Rewards_party_rewardDetails_rewards_epoch { export interface Rewards_party_rewardDetails_rewards { __typename: "Reward"; + /** + * The type of reward + */ + rewardType: AccountType; /** * The asset this reward is paid in */ diff --git a/apps/token/src/routes/rewards/home/index.tsx b/apps/token/src/routes/rewards/home/index.tsx index cb1de1a72..904faeca6 100644 --- a/apps/token/src/routes/rewards/home/index.tsx +++ b/apps/token/src/routes/rewards/home/index.tsx @@ -30,6 +30,7 @@ export const REWARDS_QUERY = gql` symbol } rewards { + rewardType asset { id } diff --git a/apps/token/src/routes/rewards/home/reward-info.tsx b/apps/token/src/routes/rewards/home/reward-info.tsx index 308cf35a3..97af23656 100644 --- a/apps/token/src/routes/rewards/home/reward-info.tsx +++ b/apps/token/src/routes/rewards/home/reward-info.tsx @@ -19,10 +19,6 @@ interface RewardInfoProps { rewardAssetId: string; } -// Note: For now the only reward type is Staking. We'll need this from the API -// at a later date -const DEFAULT_REWARD_TYPE = 'Staking'; - export const RewardInfo = ({ data, currVegaKey, @@ -119,7 +115,7 @@ export const RewardTable = ({ reward, delegations }: RewardTableProps) => { {t('rewardType')} - {DEFAULT_REWARD_TYPE} + {reward.rewardType} {t('yourStake')}