mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: no flags
This commit is contained in:
1 parent
0250546ab5
commit
e835498e59
13 files changed
+72
-61
No files matched your search
@@ -5,7 +5,7 @@ import {
|
||||
GrayColor,
|
||||
PALETTES,
|
||||
} from '../../../constants/radixColors';
|
||||
import { TREE_TYPE_ICONS, TankType, TreeTypeEnum } from '../../Tanks';
|
||||
import { TREE_TYPE_ICONS, TankType, TreeType } from '../../Tanks';
|
||||
import { RowStat } from './RowStat';
|
||||
|
||||
export interface RowStatItem {
|
||||
@@ -20,7 +20,7 @@ interface RowProps {
|
||||
type?: 'tank' | 'summary';
|
||||
title: string;
|
||||
minimized?: boolean;
|
||||
treeType?: TreeTypeEnum;
|
||||
treeType?: TreeType;
|
||||
tankType?: TankType;
|
||||
color?: AccentColor | GrayColor;
|
||||
stats: (RowStatItem | undefined)[];
|
||||
@@ -60,7 +60,7 @@ export function Row({
|
||||
>
|
||||
{type === 'tank' && tankType !== undefined && (
|
||||
<img
|
||||
src={TREE_TYPE_ICONS[treeType ?? TreeTypeEnum.TechTree][tankType]}
|
||||
src={TREE_TYPE_ICONS[treeType ?? 'researchable'][tankType]}
|
||||
style={{ width: 16, height: 16 }}
|
||||
/>
|
||||
)}
|
||||
@@ -69,9 +69,9 @@ export function Row({
|
||||
style={{
|
||||
color:
|
||||
type === 'tank'
|
||||
? treeType === TreeTypeEnum.Collector
|
||||
? treeType === 'collector'
|
||||
? theme.textLowContrast_blue
|
||||
: treeType === TreeTypeEnum.Premium
|
||||
: treeType === 'premium'
|
||||
? theme.textLowContrast_amber
|
||||
: theme.textHighContrast
|
||||
: theme.textLowContrast,
|
||||
|
||||
@@ -5,12 +5,6 @@ import {
|
||||
} from '../../../core/blitzkrieg/tankDefinitions';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export enum TreeTypeEnum {
|
||||
TechTree,
|
||||
Premium,
|
||||
Collector,
|
||||
}
|
||||
|
||||
export const TANK_TYPES = [
|
||||
'tank_destroyer',
|
||||
'light',
|
||||
@@ -22,15 +16,15 @@ export const TANK_TYPES = [
|
||||
export const TREE_TYPES = ['researchable', 'premium', 'collector'] as const;
|
||||
|
||||
export type TankType = (typeof TANK_TYPES)[number];
|
||||
export type TreeTypeString = (typeof TREE_TYPES)[number];
|
||||
export type TreeType = (typeof TREE_TYPES)[number];
|
||||
|
||||
export const TREE_TYPE_NAMES: Record<TreeTypeString, string> = {
|
||||
export const TREE_TYPE_NAMES: Record<TreeType, string> = {
|
||||
researchable: 'Tech tree',
|
||||
premium: 'Premium',
|
||||
collector: 'Collector',
|
||||
};
|
||||
|
||||
export const TREE_TYPE_IMAGES: Record<TreeTypeString, string> = {
|
||||
export const TREE_TYPE_IMAGES: Record<TreeType, string> = {
|
||||
researchable: 'https://i.imgur.com/pJxO2XY.png',
|
||||
premium: 'https://i.imgur.com/mZzSwOU.png',
|
||||
collector: 'https://i.imgur.com/7A0RsG5.png',
|
||||
@@ -40,19 +34,19 @@ export interface ItemProps {
|
||||
image?: string;
|
||||
tankType?: TankType;
|
||||
name: string;
|
||||
treeType: TreeTypeEnum;
|
||||
treeType: TreeType;
|
||||
}
|
||||
|
||||
const TREE_TYPE_COLOR = {
|
||||
[TreeTypeEnum.TechTree]: '',
|
||||
[TreeTypeEnum.Premium]: '_amber',
|
||||
[TreeTypeEnum.Collector]: '_blue',
|
||||
researchable: '',
|
||||
premium: '_amber',
|
||||
collector: '_blue',
|
||||
} as const;
|
||||
|
||||
export const TREE_TYPE_ICONS = {
|
||||
[TreeTypeEnum.TechTree]: TANK_ICONS,
|
||||
[TreeTypeEnum.Premium]: TANK_ICONS_PREMIUM,
|
||||
[TreeTypeEnum.Collector]: TANK_ICONS_COLLECTOR,
|
||||
export const TREE_TYPE_ICONS: Record<TreeType, Record<TankType, string>> = {
|
||||
researchable: TANK_ICONS,
|
||||
premium: TANK_ICONS_PREMIUM,
|
||||
collector: TANK_ICONS_COLLECTOR,
|
||||
};
|
||||
|
||||
export function Item({ image, tankType, name, treeType }: ItemProps) {
|
||||
|
||||
Reference in new issue
Block a user