mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
unit rendering
This commit is contained in:
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}>
|
||||
|
||||
Reference in new issue
Block a user