feat: show correct reward type (#930)

This commit is contained in:
Dexter Edwards 2022-08-01 17:35:09 +01:00 committed by GitHub
parent 92febfde6e
commit 8644eac2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -3,6 +3,8 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AccountType } from "@vegaprotocol/types";
// ==================================================== // ====================================================
// GraphQL query operation: Rewards // GraphQL query operation: Rewards
// ==================================================== // ====================================================
@ -45,6 +47,10 @@ export interface Rewards_party_rewardDetails_rewards_epoch {
export interface Rewards_party_rewardDetails_rewards { export interface Rewards_party_rewardDetails_rewards {
__typename: "Reward"; __typename: "Reward";
/**
* The type of reward
*/
rewardType: AccountType;
/** /**
* The asset this reward is paid in * The asset this reward is paid in
*/ */

View File

@ -30,6 +30,7 @@ export const REWARDS_QUERY = gql`
symbol symbol
} }
rewards { rewards {
rewardType
asset { asset {
id id
} }

View File

@ -19,10 +19,6 @@ interface RewardInfoProps {
rewardAssetId: string; 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 = ({ export const RewardInfo = ({
data, data,
currVegaKey, currVegaKey,
@ -119,7 +115,7 @@ export const RewardTable = ({ reward, delegations }: RewardTableProps) => {
<KeyValueTable> <KeyValueTable>
<KeyValueTableRow> <KeyValueTableRow>
{t('rewardType')} {t('rewardType')}
<span>{DEFAULT_REWARD_TYPE}</span> <span>{reward.rewardType}</span>
</KeyValueTableRow> </KeyValueTableRow>
<KeyValueTableRow> <KeyValueTableRow>
{t('yourStake')} {t('yourStake')}