fix(trading): game cards colour, missing market info, other tweaks (#5791)
This commit is contained in:
parent
1e6a2debfc
commit
1c2389dee5
@ -124,7 +124,7 @@ const TeamPage = ({
|
|||||||
onClick={() => setShowGames(true)}
|
onClick={() => setShowGames(true)}
|
||||||
data-testid="games-toggle"
|
data-testid="games-toggle"
|
||||||
>
|
>
|
||||||
{t('Games {{games}}', {
|
{t('Results {{games}}', {
|
||||||
replace: {
|
replace: {
|
||||||
games: gamesLoading ? '' : games ? `(${games.length})` : '(0)',
|
games: gamesLoading ? '' : games ? `(${games.length})` : '(0)',
|
||||||
},
|
},
|
||||||
@ -168,7 +168,7 @@ const Games = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!games?.length) {
|
if (!games?.length) {
|
||||||
return <p>{t('No games')}</p>;
|
return <p>{t('No game results available')}</p>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -68,6 +68,7 @@ export const GamesContainer = ({
|
|||||||
transferNode={game}
|
transferNode={game}
|
||||||
currentEpoch={currentEpoch}
|
currentEpoch={currentEpoch}
|
||||||
kind={transfer.kind}
|
kind={transfer.kind}
|
||||||
|
allMarkets={markets || undefined}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
@ -3,10 +3,19 @@ import { useMemo } from 'react';
|
|||||||
import { useTeamsQuery } from './__generated__/Teams';
|
import { useTeamsQuery } from './__generated__/Teams';
|
||||||
import { useTeamsStatisticsQuery } from './__generated__/TeamsStatistics';
|
import { useTeamsStatisticsQuery } from './__generated__/TeamsStatistics';
|
||||||
import compact from 'lodash/compact';
|
import compact from 'lodash/compact';
|
||||||
|
import { type TeamStatsFieldsFragment } from './__generated__/Team';
|
||||||
|
|
||||||
// 192
|
// 192
|
||||||
export const DEFAULT_AGGREGATION_EPOCHS = 192;
|
export const DEFAULT_AGGREGATION_EPOCHS = 192;
|
||||||
|
|
||||||
|
const EMPTY_STATS: Partial<TeamStatsFieldsFragment> = {
|
||||||
|
totalQuantumVolume: '0',
|
||||||
|
totalQuantumRewards: '0',
|
||||||
|
totalGamesPlayed: 0,
|
||||||
|
gamesPlayed: [],
|
||||||
|
quantumRewards: [],
|
||||||
|
};
|
||||||
|
|
||||||
export const useTeams = (aggregationEpochs = DEFAULT_AGGREGATION_EPOCHS) => {
|
export const useTeams = (aggregationEpochs = DEFAULT_AGGREGATION_EPOCHS) => {
|
||||||
const {
|
const {
|
||||||
data: teamsData,
|
data: teamsData,
|
||||||
@ -33,7 +42,7 @@ export const useTeams = (aggregationEpochs = DEFAULT_AGGREGATION_EPOCHS) => {
|
|||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
const data = teams.map((t) => ({
|
const data = teams.map((t) => ({
|
||||||
...t,
|
...t,
|
||||||
...stats.find((s) => s.teamId === t.teamId),
|
...(stats.find((s) => s.teamId === t.teamId) || EMPTY_STATS),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return orderBy(data, (d) => Number(d.totalQuantumRewards || 0), 'desc').map(
|
return orderBy(data, (d) => Number(d.totalQuantumRewards || 0), 'desc').map(
|
||||||
|
@ -123,6 +123,7 @@
|
|||||||
"Funding rate": "Funding rate",
|
"Funding rate": "Funding rate",
|
||||||
"Futures": "Futures",
|
"Futures": "Futures",
|
||||||
"Games ({{count}})": "Games ({{count}})",
|
"Games ({{count}})": "Games ({{count}})",
|
||||||
|
"Results ({{count}})": "Results ({{count}})",
|
||||||
"Generate a referral code to share with your friends and start earning commission.": "Generate a referral code to share with your friends and start earning commission.",
|
"Generate a referral code to share with your friends and start earning commission.": "Generate a referral code to share with your friends and start earning commission.",
|
||||||
"Generate code": "Generate code",
|
"Generate code": "Generate code",
|
||||||
"Get rewards for providing liquidity.": "Get rewards for providing liquidity.",
|
"Get rewards for providing liquidity.": "Get rewards for providing liquidity.",
|
||||||
@ -199,6 +200,7 @@
|
|||||||
"No funding history data": "No funding history data",
|
"No funding history data": "No funding history data",
|
||||||
"No future markets.": "No future markets.",
|
"No future markets.": "No future markets.",
|
||||||
"No games": "No games",
|
"No games": "No games",
|
||||||
|
"No game results available": "No game results available",
|
||||||
"No ledger entries to export": "No ledger entries to export",
|
"No ledger entries to export": "No ledger entries to export",
|
||||||
"No market": "No market",
|
"No market": "No market",
|
||||||
"No markets": "No markets",
|
"No markets": "No markets",
|
||||||
|
Loading…
Reference in New Issue
Block a user