feat: add marketCreationQuantumMultiple into tooltip (#3706)
This commit is contained in:
parent
e9173796f5
commit
c345623a06
@ -474,7 +474,7 @@
|
|||||||
"rewardsColLiquidityProvisionHeader": "LIQUIDITY PROVISION",
|
"rewardsColLiquidityProvisionHeader": "LIQUIDITY PROVISION",
|
||||||
"rewardsColLiquidityProvisionTooltip": "Liquidity provision rewards are distributed based on how much you have earned in liquidity fees, funded by a liquidity reward pool for that market",
|
"rewardsColLiquidityProvisionTooltip": "Liquidity provision rewards are distributed based on how much you have earned in liquidity fees, funded by a liquidity reward pool for that market",
|
||||||
"rewardsColMarketCreationHeader": "MARKET CREATION",
|
"rewardsColMarketCreationHeader": "MARKET CREATION",
|
||||||
"rewardsColMarketCreationTooltip": "Market creation rewards are paid out to the creator of any market that exceeds a set threshold of cumulative volume in a given epoch, currently [rewards.marketCreationQuantumMultiple]",
|
"rewardsColMarketCreationTooltip": "Market creation rewards are paid out to the creator of any market that exceeds a set threshold of cumulative volume in a given epoch, currently {{marketCreationQuantumMultiple}}",
|
||||||
"rewardsColTotalHeader": "TOTAL",
|
"rewardsColTotalHeader": "TOTAL",
|
||||||
"ofTotalDistributed": "of total distributed",
|
"ofTotalDistributed": "of total distributed",
|
||||||
"checkBackSoon": "Check back soon",
|
"checkBackSoon": "Check back soon",
|
||||||
|
@ -43,7 +43,10 @@ describe('EpochIndividualRewardsTable', () => {
|
|||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<AppStateProvider>
|
<AppStateProvider>
|
||||||
<EpochIndividualRewardsTable data={mockData} />
|
<EpochIndividualRewardsTable
|
||||||
|
data={mockData}
|
||||||
|
marketCreationQuantumMultiple={'1000'}
|
||||||
|
/>
|
||||||
</AppStateProvider>
|
</AppStateProvider>
|
||||||
);
|
);
|
||||||
expect(getByTestId('epoch-individual-rewards-table')).toBeInTheDocument();
|
expect(getByTestId('epoch-individual-rewards-table')).toBeInTheDocument();
|
||||||
|
@ -8,6 +8,7 @@ import type { EpochIndividualReward } from './generate-epoch-individual-rewards-
|
|||||||
|
|
||||||
interface EpochIndividualRewardsGridProps {
|
interface EpochIndividualRewardsGridProps {
|
||||||
data: EpochIndividualReward;
|
data: EpochIndividualReward;
|
||||||
|
marketCreationQuantumMultiple: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RewardItemProps {
|
interface RewardItemProps {
|
||||||
@ -69,9 +70,11 @@ const RewardItem = ({
|
|||||||
|
|
||||||
export const EpochIndividualRewardsTable = ({
|
export const EpochIndividualRewardsTable = ({
|
||||||
data,
|
data,
|
||||||
|
marketCreationQuantumMultiple,
|
||||||
}: EpochIndividualRewardsGridProps) => {
|
}: EpochIndividualRewardsGridProps) => {
|
||||||
return (
|
return (
|
||||||
<RewardsTable
|
<RewardsTable
|
||||||
|
marketCreationQuantumMultiple={marketCreationQuantumMultiple}
|
||||||
dataTestId="epoch-individual-rewards-table"
|
dataTestId="epoch-individual-rewards-table"
|
||||||
epoch={Number(data.epoch)}
|
epoch={Number(data.epoch)}
|
||||||
>
|
>
|
||||||
|
@ -9,6 +9,7 @@ import { useVegaWallet } from '@vegaprotocol/wallet';
|
|||||||
import { EpochIndividualRewardsTable } from './epoch-individual-rewards-table';
|
import { EpochIndividualRewardsTable } from './epoch-individual-rewards-table';
|
||||||
import { generateEpochIndividualRewardsList } from './generate-epoch-individual-rewards-list';
|
import { generateEpochIndividualRewardsList } from './generate-epoch-individual-rewards-list';
|
||||||
import { calculateEpochOffset } from '../../../lib/epoch-pagination';
|
import { calculateEpochOffset } from '../../../lib/epoch-pagination';
|
||||||
|
import { useNetworkParam } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
const EPOCHS_PAGE_SIZE = 10;
|
const EPOCHS_PAGE_SIZE = 10;
|
||||||
|
|
||||||
@ -26,6 +27,9 @@ export const EpochIndividualRewards = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { delegationsPagination } = ENV;
|
const { delegationsPagination } = ENV;
|
||||||
|
const { param: marketCreationQuantumMultiple } = useNetworkParam(
|
||||||
|
'rewards_marketCreationQuantumMultiple'
|
||||||
|
);
|
||||||
|
|
||||||
const { data, loading, error, refetch } = useRewardsQuery({
|
const { data, loading, error, refetch } = useRewardsQuery({
|
||||||
notifyOnNetworkStatusChange: true,
|
notifyOnNetworkStatusChange: true,
|
||||||
@ -103,6 +107,7 @@ export const EpochIndividualRewards = ({
|
|||||||
{epochIndividualRewardSummaries.map(
|
{epochIndividualRewardSummaries.map(
|
||||||
(epochIndividualRewardSummary) => (
|
(epochIndividualRewardSummary) => (
|
||||||
<EpochIndividualRewardsTable
|
<EpochIndividualRewardsTable
|
||||||
|
marketCreationQuantumMultiple={marketCreationQuantumMultiple}
|
||||||
data={epochIndividualRewardSummary}
|
data={epochIndividualRewardSummary}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -66,7 +66,10 @@ describe('EpochTotalRewardsTable', () => {
|
|||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<AppStateProvider>
|
<AppStateProvider>
|
||||||
<EpochTotalRewardsTable data={mockData} />
|
<EpochTotalRewardsTable
|
||||||
|
data={mockData}
|
||||||
|
marketCreationQuantumMultiple={'1000'}
|
||||||
|
/>
|
||||||
</AppStateProvider>
|
</AppStateProvider>
|
||||||
);
|
);
|
||||||
expect(getByTestId('epoch-total-rewards-table')).toBeInTheDocument();
|
expect(getByTestId('epoch-total-rewards-table')).toBeInTheDocument();
|
||||||
|
@ -8,6 +8,7 @@ import type { EpochTotalSummary } from './generate-epoch-total-rewards-list';
|
|||||||
|
|
||||||
interface EpochTotalRewardsGridProps {
|
interface EpochTotalRewardsGridProps {
|
||||||
data: EpochTotalSummary;
|
data: EpochTotalSummary;
|
||||||
|
marketCreationQuantumMultiple: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RewardItemProps {
|
interface RewardItemProps {
|
||||||
@ -52,9 +53,14 @@ const RewardItem = ({
|
|||||||
|
|
||||||
export const EpochTotalRewardsTable = ({
|
export const EpochTotalRewardsTable = ({
|
||||||
data,
|
data,
|
||||||
|
marketCreationQuantumMultiple,
|
||||||
}: EpochTotalRewardsGridProps) => {
|
}: EpochTotalRewardsGridProps) => {
|
||||||
return (
|
return (
|
||||||
<RewardsTable dataTestId="epoch-total-rewards-table" epoch={data.epoch}>
|
<RewardsTable
|
||||||
|
marketCreationQuantumMultiple={marketCreationQuantumMultiple}
|
||||||
|
dataTestId="epoch-total-rewards-table"
|
||||||
|
epoch={data.epoch}
|
||||||
|
>
|
||||||
{Array.from(data.assetRewards.values()).map(
|
{Array.from(data.assetRewards.values()).map(
|
||||||
({ name, rewards, totalAmount, decimals }, i) => (
|
({ name, rewards, totalAmount, decimals }, i) => (
|
||||||
<div className="contents" key={i}>
|
<div className="contents" key={i}>
|
||||||
|
@ -6,6 +6,7 @@ import { useEpochAssetsRewardsQuery } from '../home/__generated__/Rewards';
|
|||||||
import { generateEpochTotalRewardsList } from './generate-epoch-total-rewards-list';
|
import { generateEpochTotalRewardsList } from './generate-epoch-total-rewards-list';
|
||||||
import { EpochTotalRewardsTable } from './epoch-total-rewards-table';
|
import { EpochTotalRewardsTable } from './epoch-total-rewards-table';
|
||||||
import { calculateEpochOffset } from '../../../lib/epoch-pagination';
|
import { calculateEpochOffset } from '../../../lib/epoch-pagination';
|
||||||
|
import { useNetworkParam } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
const EPOCHS_PAGE_SIZE = 10;
|
const EPOCHS_PAGE_SIZE = 10;
|
||||||
|
|
||||||
@ -18,6 +19,10 @@ export const EpochTotalRewards = ({ currentEpoch }: EpochTotalRewardsProps) => {
|
|||||||
const epochId = Number(currentEpoch.id) - 1;
|
const epochId = Number(currentEpoch.id) - 1;
|
||||||
const totalPages = Math.ceil(epochId / EPOCHS_PAGE_SIZE);
|
const totalPages = Math.ceil(epochId / EPOCHS_PAGE_SIZE);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { param: marketCreationQuantumMultiple } = useNetworkParam(
|
||||||
|
'rewards_marketCreationQuantumMultiple'
|
||||||
|
);
|
||||||
|
console.log(marketCreationQuantumMultiple);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const { data, loading, error, refetch } = useEpochAssetsRewardsQuery({
|
const { data, loading, error, refetch } = useEpochAssetsRewardsQuery({
|
||||||
notifyOnNetworkStatusChange: true,
|
notifyOnNetworkStatusChange: true,
|
||||||
@ -70,7 +75,11 @@ export const EpochTotalRewards = ({ currentEpoch }: EpochTotalRewardsProps) => {
|
|||||||
>
|
>
|
||||||
{Array.from(epochTotalRewardSummaries.values()).map(
|
{Array.from(epochTotalRewardSummaries.values()).map(
|
||||||
(epochTotalSummary, index) => (
|
(epochTotalSummary, index) => (
|
||||||
<EpochTotalRewardsTable data={epochTotalSummary} key={index} />
|
<EpochTotalRewardsTable
|
||||||
|
marketCreationQuantumMultiple={marketCreationQuantumMultiple}
|
||||||
|
data={epochTotalSummary}
|
||||||
|
key={index}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
<Pagination
|
<Pagination
|
||||||
|
@ -77,7 +77,11 @@ const ColumnHeader = ({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const ColumnHeaders = () => {
|
const ColumnHeaders = ({
|
||||||
|
marketCreationQuantumMultiple,
|
||||||
|
}: {
|
||||||
|
marketCreationQuantumMultiple: string | null;
|
||||||
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div className="contents">
|
<div className="contents">
|
||||||
@ -89,7 +93,9 @@ const ColumnHeaders = () => {
|
|||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
key={columnTitle}
|
key={columnTitle}
|
||||||
title={t(columnTitle)}
|
title={t(columnTitle)}
|
||||||
tooltipContent={t(description)}
|
tooltipContent={t(description, {
|
||||||
|
marketCreationQuantumMultiple,
|
||||||
|
})}
|
||||||
className={headerGridItemStyles()}
|
className={headerGridItemStyles()}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@ -105,6 +111,7 @@ export interface RewardTableProps {
|
|||||||
dataTestId: string;
|
dataTestId: string;
|
||||||
epoch: number;
|
epoch: number;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
marketCreationQuantumMultiple: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewards table children will be the row items. Make sure they contain
|
// Rewards table children will be the row items. Make sure they contain
|
||||||
@ -113,12 +120,15 @@ export const RewardsTable = ({
|
|||||||
dataTestId,
|
dataTestId,
|
||||||
epoch,
|
epoch,
|
||||||
children,
|
children,
|
||||||
|
marketCreationQuantumMultiple,
|
||||||
}: RewardTableProps) => (
|
}: RewardTableProps) => (
|
||||||
<div data-testid={dataTestId} className="mb-12">
|
<div data-testid={dataTestId} className="mb-12">
|
||||||
<SubHeading title={`EPOCH ${epoch}`} />
|
<SubHeading title={`EPOCH ${epoch}`} />
|
||||||
|
|
||||||
<div className={gridStyles}>
|
<div className={gridStyles}>
|
||||||
<ColumnHeaders />
|
<ColumnHeaders
|
||||||
|
marketCreationQuantumMultiple={marketCreationQuantumMultiple}
|
||||||
|
/>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,6 +8,8 @@ import {
|
|||||||
export const NetworkParams = {
|
export const NetworkParams = {
|
||||||
blockchains_ethereumConfig: 'blockchains_ethereumConfig',
|
blockchains_ethereumConfig: 'blockchains_ethereumConfig',
|
||||||
reward_asset: 'reward_asset',
|
reward_asset: 'reward_asset',
|
||||||
|
rewards_marketCreationQuantumMultiple:
|
||||||
|
'rewards_marketCreationQuantumMultiple',
|
||||||
reward_staking_delegation_payoutDelay:
|
reward_staking_delegation_payoutDelay:
|
||||||
'reward_staking_delegation_payoutDelay',
|
'reward_staking_delegation_payoutDelay',
|
||||||
governance_proposal_market_minVoterBalance:
|
governance_proposal_market_minVoterBalance:
|
||||||
|
Loading…
Reference in New Issue
Block a user