mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: footer for stats
This commit is contained in:
1 parent
4c9715988d
commit
e81c0cbc1e
7 files changed
+20
-7
No files matched your search
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: true,
|
||||
inDevelopment: false,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
|
||||
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: true,
|
||||
inDevelopment: false,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
|
||||
@@ -19,7 +19,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: true,
|
||||
inDevelopment: false,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
|
||||
@@ -14,7 +14,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: true,
|
||||
inDevelopment: false,
|
||||
inPublic: true,
|
||||
|
||||
command: new SlashCommandBuilder()
|
||||
|
||||
@@ -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
@@ -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>
|
||||
);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user