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