unit rendering

This commit is contained in:
tresabhi committed 2026-06-03 12:56:30 -05:00
1 parent 3714c74394
commit bb0b932d26
5 files changed
+21 -8

No files matched your search

@@ -79,6 +79,12 @@
.value {
display: flex;
justify-content: space-between;
.units {
display: flex;
align-items: end;
gap: var(--space-2);
}
}
.ranking {
@@ -95,6 +95,7 @@ interface ItemProps {
function Item({ config, value }: ItemProps) {
const strings = useStrings();
const renderCharacteristic = useCharacteristicRenderer();
const hasUnits = config.units !== undefined;
return (
<span className={styles.item}>
@@ -106,7 +107,12 @@ function Item({ config, value }: ItemProps) {
]
}
</Text>
<Text>{renderCharacteristic(value, config)}</Text>
<Text lowContrast={hasUnits} size={hasUnits ? "minor" : undefined}>
<div className={styles.units}>
{renderCharacteristic(value, config)}
</div>
</Text>
</div>
<div className={styles.ranking}>