feat: footer for stats

This commit is contained in:
TresAbhi committed 2023-06-28 19:34:35 +00:00
1 parent 4c9715988d
commit e81c0cbc1e
7 files changed
+20 -7

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: addStatTypeSubCommandGroups(
+1 -1
View File
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: addStatTypeSubCommandGroups(
+1 -1
View File
@@ -19,7 +19,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: addStatTypeSubCommandGroups(
+1 -1
View File
@@ -14,7 +14,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export default {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -25,7 +25,7 @@ const POWERED_BY_NAMES: Record<PoweredByType, string> = {
export default function PoweredBy({ type, footer }: PoweredByProps) {
return (
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>{footer}</div>
<div style={{ display: 'flex' }}>{footer}</div>
<div style={{ display: 'flex', gap: 4 }}>
<img src={POWERED_BY_IMAGES[type]} style={{ height: 16, width: 16 }} />
+14 -1
View File
@@ -15,6 +15,7 @@ import { tankAverages } from '../core/blitzstars/tankAverages.js';
import { ResolvedPeriod } from '../core/discord/resolvePeriodFromCommand.js';
import { ResolvedPlayer } from '../core/discord/resolvePlayerFromCommand.js';
import { WARGAMING_APPLICATION_ID } from '../core/node/arguments.js';
import { theme } from '../stitches.config.js';
import {
AccountInfo,
AllStats,
@@ -127,6 +128,18 @@ export default async function stats<Type extends StatType>(
const overview = (
<AllStatsOverview stats={stats} supplementaryStats={supplementaryStats} />
);
const footer = (
<span
style={{
color: theme.colors.textLowContrast,
fontSize: 16,
display: 'flex',
gap: 4,
}}
>
<u>/statsfull</u> for all statistics
</span>
);
return naked ? (
overview
@@ -144,7 +157,7 @@ export default async function stats<Type extends StatType>(
{stats.battles === 0 && <NoData type={NoDataType.BattlesInPeriod} />}
{stats.battles > 0 && overview}
<PoweredBy type={PoweredByType.BlitzStars} />
<PoweredBy type={PoweredByType.BlitzStars} footer={footer} />
</Wrapper>
);
}
+1 -1
View File
@@ -6,7 +6,7 @@ import { RouterRegistry } from '../server.js';
export default {
route: '/stats/:type/:period',
inProduction: true,
inDevelopment: true,
inDevelopment: false,
async handler(req) {
const type = req.params.type as StatType;