mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: no tanks heads up in /ownedtanks
This commit is contained in:
1 parent
524edac615
commit
238661ac16
15 files changed
+38
-31
No files matched your search
@@ -13,7 +13,7 @@ const executionStart = new Date().getTime();
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const SKILLED_CLANS: Record<SkilledClan, string> = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: false,
|
inPublic: false,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { client } from '../index.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const DEFAULT_THRESHOLD = 7;
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!hasInactiveMembers && <NoData type={NoDataType.Players} />}
|
{!hasInactiveMembers && <NoData type={NoDataType.PlayersInPeriod} />}
|
||||||
{hasInactiveMembers && <GenericStats stats={inactive} />}
|
{hasInactiveMembers && <GenericStats stats={inactive} />}
|
||||||
|
|
||||||
<PoweredByWargaming />
|
<PoweredByWargaming />
|
||||||
|
|||||||
+15
-10
@@ -1,4 +1,5 @@
|
|||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
|
import NoData, { NoDataType } from '../components/NoData.js';
|
||||||
import PoweredByWargaming from '../components/PoweredByWargaming.js';
|
import PoweredByWargaming from '../components/PoweredByWargaming.js';
|
||||||
import * as Tanks from '../components/Tanks/index.js';
|
import * as Tanks from '../components/Tanks/index.js';
|
||||||
import TitleBar from '../components/TitleBar.js';
|
import TitleBar from '../components/TitleBar.js';
|
||||||
@@ -88,16 +89,20 @@ export default {
|
|||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tanks.Root>
|
{tanks.length === 0 && <NoData type={NoDataType.TanksFound} />}
|
||||||
{tanks.map((tank) => (
|
|
||||||
<Tanks.Item
|
{tanks.length > 0 && (
|
||||||
key={tank.tank_id}
|
<Tanks.Root>
|
||||||
name={tank.name}
|
{tanks.map((tank) => (
|
||||||
type={tank.type}
|
<Tanks.Item
|
||||||
icon={tank.images.normal}
|
key={tank.tank_id}
|
||||||
/>
|
name={tank.name}
|
||||||
))}
|
type={tank.type}
|
||||||
</Tanks.Root>
|
icon={tank.images.normal}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Tanks.Root>
|
||||||
|
)}
|
||||||
|
|
||||||
<PoweredByWargaming />
|
<PoweredByWargaming />
|
||||||
</Wrapper>,
|
</Wrapper>,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ type SortBy = 'name' | 'count';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { ClanList } from '../types/clanList.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { AccountList } from '../types/accountList.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { CommandRegistry } from '../events/interactionCreate.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import { PlayerClanData } from '../types/playerClanData.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
@@ -151,7 +151,7 @@ export default {
|
|||||||
} • ${new Date().toDateString()} • ${BLITZ_SERVERS[server]}`}
|
} • ${new Date().toDateString()} • ${BLITZ_SERVERS[server]}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{stats.battles === 0 && <NoData type={NoDataType.Battles} />}
|
{stats.battles === 0 && <NoData type={NoDataType.BattlesInPeriod} />}
|
||||||
{stats.battles > 0 && (
|
{stats.battles > 0 && (
|
||||||
<GenericAllStats
|
<GenericAllStats
|
||||||
stats={stats}
|
stats={stats}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import { AccountInfo, AllStats } from '../types/accountInfo.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
} • ${new Date().toDateString()} • ${BLITZ_SERVERS[server]}`}
|
} • ${new Date().toDateString()} • ${BLITZ_SERVERS[server]}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{stats.battles === 0 && <NoData type={NoDataType.Battles} />}
|
{stats.battles === 0 && <NoData type={NoDataType.BattlesInPeriod} />}
|
||||||
{stats.battles > 0 && (
|
{stats.battles > 0 && (
|
||||||
<GenericAllStats
|
<GenericAllStats
|
||||||
stats={stats}
|
stats={stats}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { PlayerClanData } from '../types/playerClanData.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
@@ -176,7 +176,7 @@ export default {
|
|||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{rows.length === 0 && <NoData type={NoDataType.Battles} />}
|
{rows.length === 0 && <NoData type={NoDataType.BattlesInPeriod} />}
|
||||||
{rows.length > 0 && <Breakdown.Root>{rows}</Breakdown.Root>}
|
{rows.length > 0 && <Breakdown.Root>{rows}</Breakdown.Root>}
|
||||||
|
|
||||||
<PoweredByBlitzStars />
|
<PoweredByBlitzStars />
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { PlayerClanData } from '../types/playerClanData.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { theme } from '../stitches.config.js';
|
import { theme } from '../stitches.config.js';
|
||||||
|
|
||||||
export enum NoDataType {
|
export enum NoDataType {
|
||||||
Battles,
|
BattlesInPeriod,
|
||||||
Players,
|
PlayersInPeriod,
|
||||||
|
TanksFound,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NoDataProps {
|
export interface NoDataProps {
|
||||||
@@ -10,8 +11,9 @@ export interface NoDataProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const NO_DATA_MESSAGES: Record<NoDataType, string> = {
|
const NO_DATA_MESSAGES: Record<NoDataType, string> = {
|
||||||
[NoDataType.Battles]: 'No battles played in this period',
|
[NoDataType.BattlesInPeriod]: 'No battles played in this period',
|
||||||
[NoDataType.Players]: 'No players in this period',
|
[NoDataType.PlayersInPeriod]: 'No players in this period',
|
||||||
|
[NoDataType.TanksFound]: 'No tanks found',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function NoData({ type }: NoDataProps) {
|
export default function NoData({ type }: NoDataProps) {
|
||||||
|
|||||||
Reference in new issue
Block a user