mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 04:14:12 +01:00
migrate compare and tankopedia loadout to new data-driven components, splitting the old monolithic loadout and compare UI into smaller pieces and adding shared Table, Dialog and Scroller primitives
This commit is contained in:
111 files changed
+4009
-3917
No files matched your search
@@ -0,0 +1,5 @@
|
||||
.value {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { useCharacteristicRenderer } from "../../hooks/useCharacteristicRenderer";
|
||||
import type {
|
||||
CharacteristicRenderConfig,
|
||||
CharacteristicReturnType,
|
||||
} from "../../types/characteristics";
|
||||
import { Text } from "../Text";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
interface CharacteristicValueProps {
|
||||
config: CharacteristicRenderConfig;
|
||||
value: CharacteristicReturnType;
|
||||
units?: boolean;
|
||||
}
|
||||
|
||||
export function CharacteristicValue({
|
||||
config,
|
||||
value,
|
||||
units = true,
|
||||
}: CharacteristicValueProps) {
|
||||
const renderCharacteristic = useCharacteristicRenderer(units);
|
||||
const hasUnits = units && config.units !== undefined;
|
||||
|
||||
return (
|
||||
<Text
|
||||
className={styles.value}
|
||||
lowContrast={hasUnits}
|
||||
size={hasUnits ? "minor" : undefined}
|
||||
>
|
||||
{renderCharacteristic(value, config)}
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user