fix: no tanks heads up in /ownedtanks

This commit is contained in:
TresAbhi committed 2023-06-06 16:53:13 +00:00
1 parent 524edac615
commit 238661ac16
15 files changed
+38 -31

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ const executionStart = new Date().getTime();
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -26,7 +26,7 @@ export const SKILLED_CLANS: Record<SkilledClan, string> = {
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: false,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -11,7 +11,7 @@ import { client } from '../index.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+2 -2
View File
@@ -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
View File
@@ -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>,
+1 -1
View File
@@ -17,7 +17,7 @@ type SortBy = 'name' | 'count';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -13,7 +13,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -12,7 +12,7 @@ import { ClanList } from '../types/clanList.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -13,7 +13,7 @@ import { AccountList } from '../types/accountList.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -9,7 +9,7 @@ import { CommandRegistry } from '../events/interactionCreate.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+2 -2
View File
@@ -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}
+2 -2
View File
@@ -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}
+2 -2
View File
@@ -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 />
+1 -1
View File
@@ -14,7 +14,7 @@ import { PlayerClanData } from '../types/playerClanData.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+6 -4
View File
@@ -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) {