From 238661ac160b2a34704670ea3c5fbea274a6da4f Mon Sep 17 00:00:00 2001 From: tresabhi Date: Tue, 6 Jun 2023 16:53:13 +0000 Subject: [PATCH] fix: no tanks heads up in /ownedtanks --- src/commands/debug.ts | 2 +- src/commands/eligible.ts | 2 +- src/commands/help.ts | 2 +- src/commands/inactive.tsx | 4 ++-- src/commands/ownedtanks.tsx | 25 +++++++++++++++---------- src/commands/playerachievements.ts | 2 +- src/commands/playerinfo.ts | 2 +- src/commands/searchclans.ts | 2 +- src/commands/searchplayers.ts | 2 +- src/commands/searchtanks.ts | 2 +- src/commands/stats.tsx | 4 ++-- src/commands/tankstats.tsx | 4 ++-- src/commands/today.tsx | 4 ++-- src/commands/verify.ts | 2 +- src/components/NoData.tsx | 10 ++++++---- 15 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/commands/debug.ts b/src/commands/debug.ts index 0c3b94b27..278060b45 100644 --- a/src/commands/debug.ts +++ b/src/commands/debug.ts @@ -13,7 +13,7 @@ const executionStart = new Date().getTime(); export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/eligible.ts b/src/commands/eligible.ts index 24060f7c8..f4091a0b3 100644 --- a/src/commands/eligible.ts +++ b/src/commands/eligible.ts @@ -26,7 +26,7 @@ export const SKILLED_CLANS: Record = { export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: false, command: new SlashCommandBuilder() diff --git a/src/commands/help.ts b/src/commands/help.ts index 327e465bc..0b1511cb8 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -11,7 +11,7 @@ import { client } from '../index.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/inactive.tsx b/src/commands/inactive.tsx index 3fd4a59c5..8d4541ee5 100644 --- a/src/commands/inactive.tsx +++ b/src/commands/inactive.tsx @@ -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 && } + {!hasInactiveMembers && } {hasInactiveMembers && } diff --git a/src/commands/ownedtanks.tsx b/src/commands/ownedtanks.tsx index 55f7a434d..5c98f039e 100644 --- a/src/commands/ownedtanks.tsx +++ b/src/commands/ownedtanks.tsx @@ -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.map((tank) => ( - - ))} - + {tanks.length === 0 && } + + {tanks.length > 0 && ( + + {tanks.map((tank) => ( + + ))} + + )} , diff --git a/src/commands/playerachievements.ts b/src/commands/playerachievements.ts index 25847ac8f..536e1bed9 100644 --- a/src/commands/playerachievements.ts +++ b/src/commands/playerachievements.ts @@ -17,7 +17,7 @@ type SortBy = 'name' | 'count'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/playerinfo.ts b/src/commands/playerinfo.ts index ae4dd54d9..82c83a05d 100644 --- a/src/commands/playerinfo.ts +++ b/src/commands/playerinfo.ts @@ -13,7 +13,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchclans.ts b/src/commands/searchclans.ts index d3f3e88a1..db07881eb 100644 --- a/src/commands/searchclans.ts +++ b/src/commands/searchclans.ts @@ -12,7 +12,7 @@ import { ClanList } from '../types/clanList.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchplayers.ts b/src/commands/searchplayers.ts index b196d8d70..d0f731cd8 100644 --- a/src/commands/searchplayers.ts +++ b/src/commands/searchplayers.ts @@ -13,7 +13,7 @@ import { AccountList } from '../types/accountList.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchtanks.ts b/src/commands/searchtanks.ts index 0e4d2d469..2d525cdc0 100644 --- a/src/commands/searchtanks.ts +++ b/src/commands/searchtanks.ts @@ -9,7 +9,7 @@ import { CommandRegistry } from '../events/interactionCreate.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/stats.tsx b/src/commands/stats.tsx index 31dd32681..81602e500 100644 --- a/src/commands/stats.tsx +++ b/src/commands/stats.tsx @@ -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 && } + {stats.battles === 0 && } {stats.battles > 0 && ( - {stats.battles === 0 && } + {stats.battles === 0 && } {stats.battles > 0 && ( - {rows.length === 0 && } + {rows.length === 0 && } {rows.length > 0 && {rows}} diff --git a/src/commands/verify.ts b/src/commands/verify.ts index cdbe4d674..7ffa34a8b 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -14,7 +14,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/components/NoData.tsx b/src/components/NoData.tsx index 1b4231829..003ed8040 100644 --- a/src/components/NoData.tsx +++ b/src/components/NoData.tsx @@ -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.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) {