mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: some type prefixes
This commit is contained in:
1 parent
dc60cffdff
commit
0d8cb5c1ae
31 files changed
+225
-222
No files matched your search
@@ -1,28 +1,31 @@
|
||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||
import { translator } from '../core/localization/translator';
|
||||
import { COMMANDS_RAW, CommandRegistry } from '../events/interactionCreate';
|
||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import {
|
||||
COMMANDS_RAW,
|
||||
type CommandRegistry,
|
||||
} from "../events/interactionCreate";
|
||||
|
||||
const subcommands = [
|
||||
'embeds',
|
||||
'introduction',
|
||||
'invite',
|
||||
'timezones',
|
||||
'credits',
|
||||
"embeds",
|
||||
"introduction",
|
||||
"invite",
|
||||
"timezones",
|
||||
"credits",
|
||||
] as const;
|
||||
type Subcommand = (typeof subcommands)[number];
|
||||
|
||||
const DOCS: Record<Subcommand, string> = {
|
||||
embeds: 'guide/embeds',
|
||||
introduction: 'guide/introduction',
|
||||
invite: 'guide/invite',
|
||||
timezones: 'guide/timezones',
|
||||
credits: 'about/credits',
|
||||
embeds: "guide/embeds",
|
||||
introduction: "guide/introduction",
|
||||
invite: "guide/invite",
|
||||
timezones: "guide/timezones",
|
||||
credits: "about/credits",
|
||||
};
|
||||
|
||||
export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
resolve({
|
||||
command: createLocalizedCommand('about', [
|
||||
{ subcommand: 'commands' },
|
||||
command: createLocalizedCommand("about", [
|
||||
{ subcommand: "commands" },
|
||||
...subcommands.map((subcommand) => ({ subcommand })),
|
||||
]),
|
||||
|
||||
@@ -30,7 +33,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const { strings } = translator(interaction.locale);
|
||||
|
||||
if (subcommand === 'commands') {
|
||||
if (subcommand === "commands") {
|
||||
return `${strings.bot.commands.about.subcommands.commands.body}${(
|
||||
await Promise.all(COMMANDS_RAW)
|
||||
)
|
||||
@@ -40,7 +43,7 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
(b.command.name_localizations?.[interaction.locale] ??
|
||||
b.command.name)
|
||||
? -1
|
||||
: 1,
|
||||
: 1
|
||||
)
|
||||
.map(
|
||||
(registry) =>
|
||||
@@ -51,9 +54,9 @@ export const aboutCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
registry.command.description_localizations?.[
|
||||
interaction.locale
|
||||
] ?? registry.command.description
|
||||
}`,
|
||||
}`
|
||||
)
|
||||
.join('\n')}`;
|
||||
.join("\n")}`;
|
||||
}
|
||||
|
||||
const url = `https://raw.githubusercontent.com/tresabhi/blitzkit/main/docs/${DOCS[subcommand as Subcommand]}.md`;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { resolvePeriodFromButton } from '../../core/discord/resolvePeriodFromBut
|
||||
import { resolvePeriodFromCommand } from '../../core/discord/resolvePeriodFromCommand';
|
||||
import { resolvePlayerFromButton } from '../../core/discord/resolvePlayerFromButton';
|
||||
import { resolvePlayerFromCommand } from '../../core/discord/resolvePlayerFromCommand';
|
||||
import { CommandRegistry } from '../../events/interactionCreate';
|
||||
import type { CommandRegistry } from '../../events/interactionCreate';
|
||||
import { renderBreakdown } from './render';
|
||||
|
||||
export const breakdownCommand = new Promise<CommandRegistry>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
BlitzStats,
|
||||
type BlitzStats,
|
||||
calculateWN8,
|
||||
getAccountInfo,
|
||||
getClanAccountInfo,
|
||||
@@ -17,11 +17,11 @@ import { TitleBar } from "../../components/TitleBar";
|
||||
import { filtersToDescription } from "../../core/blitzkit/filtersToDescription";
|
||||
import { tankDefinitions } from "../../core/blitzkit/nonBlockingPromises";
|
||||
import { UserError } from "../../core/blitzkit/userError";
|
||||
import { filterStats, StatFilters } from "../../core/blitzstars/filterStats";
|
||||
import { filterStats, type StatFilters } from "../../core/blitzstars/filterStats";
|
||||
import { getStatsInPeriod } from "../../core/blitzstars/getStatsInPeriod";
|
||||
import { blitzStarsTankAverages } from "../../core/blitzstars/tankAverages";
|
||||
import { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
|
||||
import { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
|
||||
import type { ResolvedPeriod } from "../../core/discord/resolvePeriodFromCommand";
|
||||
import type { ResolvedPlayer } from "../../core/discord/resolvePlayerFromCommand";
|
||||
import { translator } from "../../core/localization/translator";
|
||||
|
||||
const ROWS_PER_PAGE = 8;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import packageJSON from '../../../../package.json';
|
||||
import { client } from '../core/discord/client';
|
||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||
import { translator } from '../core/localization/translator';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import packageJSON from "../../../../package.json";
|
||||
import { client } from "../core/discord/client";
|
||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
const executionStart = new Date().getTime();
|
||||
|
||||
export const debugCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
resolve({
|
||||
command: createLocalizedCommand('debug'),
|
||||
command: createLocalizedCommand("debug"),
|
||||
|
||||
async handler(interaction) {
|
||||
const { strings } = translator(interaction.locale);
|
||||
@@ -23,15 +23,15 @@ export const debugCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
[
|
||||
strings.bot.commands.debug.body.uptime,
|
||||
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
|
||||
(uptime / 1000 / 60) % 60,
|
||||
(uptime / 1000 / 60) % 60
|
||||
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
|
||||
uptime % 1000,
|
||||
uptime % 1000
|
||||
)}ms`,
|
||||
],
|
||||
];
|
||||
return `${strings.bot.commands.debug.body.title}${list
|
||||
.map(([key, value]) => `- ${key}: ${value}`)
|
||||
.join('\n')}`;
|
||||
.join("\n")}`;
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -11,7 +11,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { localizationObject } from "../core/discord/localizationObject";
|
||||
import { resolveClanFromCommand } from "../core/discord/resolveClanFromCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
const DEFAULT_THRESHOLD = 7;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||
import { embedInfo } from '../core/discord/embedInfo';
|
||||
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { translator } from '../core/localization/translator';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import type { CommandRegistry } from '../events/interactionCreate';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export const verifyCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { literals } from "@blitzkit/i18n";
|
||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
export const pingCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
resolve({
|
||||
|
||||
@@ -22,7 +22,7 @@ import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
import { theme } from "../stitches.config";
|
||||
|
||||
const LEAGUE_ACCENT = [
|
||||
|
||||
@@ -10,13 +10,13 @@ import {
|
||||
imgur,
|
||||
isOnGoingRatingSeason,
|
||||
LEAGUES,
|
||||
RatingInfo,
|
||||
type RatingInfo,
|
||||
RatingLeaderboard,
|
||||
Region,
|
||||
type Region,
|
||||
} from "@blitzkit/core";
|
||||
import { literals } from "@blitzkit/i18n";
|
||||
import {
|
||||
APIApplicationCommandOptionChoice,
|
||||
type APIApplicationCommandOptionChoice,
|
||||
Locale,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
@@ -33,7 +33,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { localizationObject } from "../core/discord/localizationObject";
|
||||
import { resolvePlayerFromCommand } from "../core/discord/resolvePlayerFromCommand";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
interface SimplifiedPlayer {
|
||||
id: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ClanList, fetchBlitz, Region } from "@blitzkit/core";
|
||||
import { type ClanList, fetchBlitz, type Region } from "@blitzkit/core";
|
||||
import { literals } from "@blitzkit/i18n";
|
||||
import { Locale } from "discord.js";
|
||||
import markdownEscape from "markdown-escape";
|
||||
@@ -8,7 +8,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { embedInfo } from "../core/discord/embedInfo";
|
||||
import { localizationObject } from "../core/discord/localizationObject";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
const DEFAULT_LIMIT = 25;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
AccountList,
|
||||
type AccountList,
|
||||
fetchBlitz,
|
||||
Region,
|
||||
type Region,
|
||||
usernamePattern,
|
||||
} from "@blitzkit/core";
|
||||
import { literals } from "@blitzkit/i18n";
|
||||
@@ -13,7 +13,7 @@ import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { embedInfo } from "../core/discord/embedInfo";
|
||||
import { localizationObject } from "../core/discord/localizationObject";
|
||||
import { translator } from "../core/localization/translator";
|
||||
import { CommandRegistry } from "../events/interactionCreate";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
const DEFAULT_LIMIT = 25;
|
||||
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
import { emblemURL, getAccountInfo, getClanAccountInfo } from '@blitzkit/core';
|
||||
import { Locale } from 'discord.js';
|
||||
import { AllStatsOverview } from '../components/AllStatsOverview';
|
||||
import { CommandWrapper } from '../components/CommandWrapper';
|
||||
import { NoData } from '../components/NoData';
|
||||
import { TitleBar } from '../components/TitleBar';
|
||||
import { filtersToDescription } from '../core/blitzkit/filtersToDescription';
|
||||
import { filterStats, StatFilters } from '../core/blitzstars/filterStats';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import { getStatsInPeriod } from '../core/blitzstars/getStatsInPeriod';
|
||||
import { addPeriodicFilterOptions } from '../core/discord/addPeriodicFilterOptions';
|
||||
import { addUsernameChoices } from '../core/discord/addUsernameChoices';
|
||||
import { autocompleteTanks } from '../core/discord/autocompleteTanks';
|
||||
import { autocompleteUsername } from '../core/discord/autocompleteUsername';
|
||||
import { buttonRefresh } from '../core/discord/buttonRefresh';
|
||||
import { commandToURL } from '../core/discord/commandToURL';
|
||||
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
|
||||
import { getCustomPeriodParams } from '../core/discord/getCustomPeriodParams';
|
||||
import { getFiltersFromButton } from '../core/discord/getFiltersFromButton';
|
||||
import { getFiltersFromCommand } from '../core/discord/getFiltersFromCommand';
|
||||
import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton';
|
||||
import { emblemURL, getAccountInfo, getClanAccountInfo } from "@blitzkit/core";
|
||||
import { Locale } from "discord.js";
|
||||
import { AllStatsOverview } from "../components/AllStatsOverview";
|
||||
import { CommandWrapper } from "../components/CommandWrapper";
|
||||
import { NoData } from "../components/NoData";
|
||||
import { TitleBar } from "../components/TitleBar";
|
||||
import { filtersToDescription } from "../core/blitzkit/filtersToDescription";
|
||||
import { filterStats, type StatFilters } from "../core/blitzstars/filterStats";
|
||||
import { getBlitzStarsLinkButton } from "../core/blitzstars/getBlitzStarsLinkButton";
|
||||
import { getStatsInPeriod } from "../core/blitzstars/getStatsInPeriod";
|
||||
import { addPeriodicFilterOptions } from "../core/discord/addPeriodicFilterOptions";
|
||||
import { addUsernameChoices } from "../core/discord/addUsernameChoices";
|
||||
import { autocompleteTanks } from "../core/discord/autocompleteTanks";
|
||||
import { autocompleteUsername } from "../core/discord/autocompleteUsername";
|
||||
import { buttonRefresh } from "../core/discord/buttonRefresh";
|
||||
import { commandToURL } from "../core/discord/commandToURL";
|
||||
import { createLocalizedCommand } from "../core/discord/createLocalizedCommand";
|
||||
import { getCustomPeriodParams } from "../core/discord/getCustomPeriodParams";
|
||||
import { getFiltersFromButton } from "../core/discord/getFiltersFromButton";
|
||||
import { getFiltersFromCommand } from "../core/discord/getFiltersFromCommand";
|
||||
import { resolvePeriodFromButton } from "../core/discord/resolvePeriodFromButton";
|
||||
import {
|
||||
ResolvedPeriod,
|
||||
type ResolvedPeriod,
|
||||
resolvePeriodFromCommand,
|
||||
} from '../core/discord/resolvePeriodFromCommand';
|
||||
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
|
||||
} from "../core/discord/resolvePeriodFromCommand";
|
||||
import { resolvePlayerFromButton } from "../core/discord/resolvePlayerFromButton";
|
||||
import {
|
||||
ResolvedPlayer,
|
||||
type ResolvedPlayer,
|
||||
resolvePlayerFromCommand,
|
||||
} from '../core/discord/resolvePlayerFromCommand';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
} from "../core/discord/resolvePlayerFromCommand";
|
||||
import type { CommandRegistry } from "../events/interactionCreate";
|
||||
|
||||
async function render(
|
||||
{ region, id }: ResolvedPlayer,
|
||||
{ start, end, name }: ResolvedPeriod,
|
||||
filters: StatFilters,
|
||||
locale: Locale,
|
||||
locale: Locale
|
||||
) {
|
||||
const { nickname } = await getAccountInfo(region, id);
|
||||
const clan = (await getClanAccountInfo(region, id, ['clan']))?.clan;
|
||||
const clan = (await getClanAccountInfo(region, id, ["clan"]))?.clan;
|
||||
const clanImage = clan ? emblemURL(clan.emblem_set_id) : undefined;
|
||||
const diffedTankStats = await getStatsInPeriod(
|
||||
region,
|
||||
id,
|
||||
start,
|
||||
end,
|
||||
locale,
|
||||
locale
|
||||
);
|
||||
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
||||
const filterDescriptions = await filtersToDescription(filters, locale);
|
||||
@@ -72,8 +72,8 @@ async function render(
|
||||
export const statsCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
resolve({
|
||||
command: await addPeriodicFilterOptions(
|
||||
createLocalizedCommand('stats'),
|
||||
(option) => option.addStringOption(addUsernameChoices),
|
||||
createLocalizedCommand("stats"),
|
||||
(option) => option.addStringOption(addUsernameChoices)
|
||||
),
|
||||
|
||||
async handler(interaction) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { resolvePeriodFromButton } from '../core/discord/resolvePeriodFromButton
|
||||
import { resolvePeriodFromCommand } from '../core/discord/resolvePeriodFromCommand';
|
||||
import { resolvePlayerFromButton } from '../core/discord/resolvePlayerFromButton';
|
||||
import { resolvePlayerFromCommand } from '../core/discord/resolvePlayerFromCommand';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import { type CommandRegistry } from '../events/interactionCreate';
|
||||
import { renderBreakdown } from './breakdown/render';
|
||||
|
||||
export const todayCommand = new Promise<CommandRegistry>(async (resolve) => {
|
||||
|
||||
+10
-10
@@ -1,8 +1,8 @@
|
||||
import { ComponentProps } from 'react';
|
||||
import { type ComponentProps } from "react";
|
||||
|
||||
export interface GlowProps extends ComponentProps<'div'> {
|
||||
export interface GlowProps extends ComponentProps<"div"> {
|
||||
color: string;
|
||||
direction?: 'default' | 'reverse';
|
||||
direction?: "default" | "reverse";
|
||||
rotation?: number;
|
||||
startOpacity?: number;
|
||||
endOpacity?: number;
|
||||
@@ -12,7 +12,7 @@ const width = 16;
|
||||
|
||||
export function Glow({
|
||||
color,
|
||||
direction = 'default',
|
||||
direction = "default",
|
||||
rotation = 0,
|
||||
style,
|
||||
startOpacity = 0,
|
||||
@@ -21,20 +21,20 @@ export function Glow({
|
||||
}: GlowProps) {
|
||||
const color1 = `${color}${Math.round(endOpacity * 255)
|
||||
.toString(16)
|
||||
.padStart(2, '0')}`;
|
||||
.padStart(2, "0")}`;
|
||||
const color2 = `${color}${Math.round(startOpacity * 255)
|
||||
.toString(16)
|
||||
.padStart(2, '0')}`;
|
||||
.padStart(2, "0")}`;
|
||||
const background = `linear-gradient(${
|
||||
direction === 'default' ? 0 : 180
|
||||
direction === "default" ? 0 : 180
|
||||
}deg, ${color1} 0%, ${color2} 100%)`;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: direction === 'default' ? 'flex-end' : 'flex-start',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
alignItems: direction === "default" ? "flex-end" : "flex-start",
|
||||
justifyContent: "center",
|
||||
transform: `rotate(${rotation}deg)`,
|
||||
...style,
|
||||
}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
getWN8Percentile,
|
||||
Percentile,
|
||||
SupplementaryStats,
|
||||
type SupplementaryStats,
|
||||
} from '@blitzkit/core';
|
||||
import { Locale } from 'discord.js';
|
||||
import { translator } from '../../core/localization/translator';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { theme } from '../stitches.config';
|
||||
import { type ReactNode } from "react";
|
||||
import { theme } from "../stitches.config";
|
||||
|
||||
interface CommandWrapperProps {
|
||||
children: ReactNode;
|
||||
@@ -10,14 +10,14 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
padding: `16px ${fat ? 0 : 16}px`,
|
||||
gap: 16,
|
||||
width: '100%',
|
||||
width: "100%",
|
||||
color: theme.colors.textHighContrast,
|
||||
backgroundColor: theme.colors.appBackground1,
|
||||
position: 'relative',
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
BlitzStats,
|
||||
type BlitzStats,
|
||||
getWN8Percentile,
|
||||
isNumber,
|
||||
SupplementaryStats,
|
||||
type SupplementaryStats,
|
||||
} from '@blitzkit/core';
|
||||
import { Locale } from 'discord.js';
|
||||
import { translator } from '../../core/localization/translator';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { times } from 'lodash-es';
|
||||
import { theme } from '../../../../stitches.config';
|
||||
import { MarginInputProps } from '../Root';
|
||||
import { type MarginInputProps } from '../Root';
|
||||
import { MarginOrientation } from './constants';
|
||||
|
||||
interface MarginProps extends MarginInputProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ComponentProps } from 'react';
|
||||
import { theme } from '../../../stitches.config';
|
||||
import { type ComponentProps } from "react";
|
||||
import { theme } from "../../../stitches.config";
|
||||
|
||||
interface ItemProps extends ComponentProps<'div'> {
|
||||
interface ItemProps extends ComponentProps<"div"> {
|
||||
position: number;
|
||||
deltaPosition?: number;
|
||||
score?: number;
|
||||
@@ -25,15 +25,15 @@ export function Item({
|
||||
<div
|
||||
{...props}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
cursor: "pointer",
|
||||
display: "flex",
|
||||
padding: 8,
|
||||
backgroundColor: highlight
|
||||
? theme.colors.componentInteractive_blue
|
||||
: theme.colors.componentInteractive,
|
||||
borderRadius: 4,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 8,
|
||||
}}
|
||||
>
|
||||
@@ -50,9 +50,9 @@ export function Item({
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 4,
|
||||
}}
|
||||
>
|
||||
@@ -83,22 +83,22 @@ export function Item({
|
||||
{deltaPosition !== undefined && deltaPosition !== 0 && (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 4,
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt={deltaPosition > 0 ? 'Increase' : 'Decrease'}
|
||||
alt={deltaPosition > 0 ? "Increase" : "Decrease"}
|
||||
style={{
|
||||
width: 8,
|
||||
height: 8,
|
||||
}}
|
||||
src={
|
||||
deltaPosition > 0
|
||||
? 'https://i.imgur.com/qbjiXa1.png'
|
||||
: 'https://i.imgur.com/3uyNhun.png'
|
||||
? "https://i.imgur.com/qbjiXa1.png"
|
||||
: "https://i.imgur.com/3uyNhun.png"
|
||||
}
|
||||
/>
|
||||
<span
|
||||
@@ -119,11 +119,11 @@ export function Item({
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
display: "flex",
|
||||
gap: 4,
|
||||
alignItems: 'center',
|
||||
alignItems: "center",
|
||||
width: 96,
|
||||
justifyContent: 'flex-end',
|
||||
justifyContent: "flex-end",
|
||||
}}
|
||||
>
|
||||
{deltaScore !== 0 && deltaScore !== undefined && (
|
||||
@@ -140,15 +140,15 @@ export function Item({
|
||||
)}
|
||||
{deltaScore !== 0 && deltaScore !== undefined && (
|
||||
<img
|
||||
alt={deltaScore > 0 ? 'Increase' : 'Decrease'}
|
||||
alt={deltaScore > 0 ? "Increase" : "Decrease"}
|
||||
style={{
|
||||
width: 8,
|
||||
height: 8,
|
||||
}}
|
||||
src={
|
||||
deltaScore > 0
|
||||
? 'https://i.imgur.com/qbjiXa1.png'
|
||||
: 'https://i.imgur.com/3uyNhun.png'
|
||||
? "https://i.imgur.com/qbjiXa1.png"
|
||||
: "https://i.imgur.com/3uyNhun.png"
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { type ReactNode } from 'react';
|
||||
|
||||
interface ColumnProps {
|
||||
children: ReactNode;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
interface RootProps {
|
||||
children: ReactNode;
|
||||
@@ -8,8 +8,8 @@ export function Root({ children }: RootProps) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 16,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
interface RowProps {
|
||||
children: ReactNode;
|
||||
@@ -8,7 +8,7 @@ export function Row({ children }: RowProps) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
display: "flex",
|
||||
gap: 8,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TierWeightsRecord } from '@blitzkit/core';
|
||||
import { theme } from '../stitches.config';
|
||||
import type { TierWeightsRecord } from "@blitzkit/core";
|
||||
import { theme } from "../stitches.config";
|
||||
|
||||
interface TierWeightsProps {
|
||||
weights: TierWeightsRecord;
|
||||
@@ -7,7 +7,7 @@ interface TierWeightsProps {
|
||||
|
||||
export function TierWeights({ weights }: TierWeightsProps) {
|
||||
return (
|
||||
<div style={{ display: 'flex', gap: 8 }}>
|
||||
<div style={{ display: "flex", gap: 8 }}>
|
||||
{Object.entries(weights).map(([tier, weight]) => (
|
||||
<div
|
||||
key={tier}
|
||||
@@ -15,11 +15,11 @@ export function TierWeights({ weights }: TierWeightsProps) {
|
||||
backgroundColor: theme.colors.appBackground1_light,
|
||||
flex: weight,
|
||||
color: theme.colors.textHighContrast_light,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
fontSize: 16,
|
||||
overflow: 'hidden',
|
||||
overflow: "hidden",
|
||||
borderRadius: 8,
|
||||
minWidth: 16,
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user