mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-27 00:17:32 +01:00
Merge pull request #2251 from MartinFournier/fix/corp-storage-tooltip
Fix #2129: Add linebreaks in corp storage tooltips
This commit is contained in:
commit
d53b87b8ce
@ -108,31 +108,22 @@ function WarehouseRoot(props: IProps): React.ReactElement {
|
||||
}
|
||||
}
|
||||
|
||||
let breakdown = <></>;
|
||||
const breakdownItems: string[] = [];
|
||||
for (const matName in props.warehouse.materials) {
|
||||
const mat = props.warehouse.materials[matName];
|
||||
if (!MaterialSizes.hasOwnProperty(matName)) continue;
|
||||
if (mat.qty === 0) continue;
|
||||
breakdown = (
|
||||
<>
|
||||
{breakdown}
|
||||
{matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], "0,0.0")}
|
||||
<br />
|
||||
</>
|
||||
);
|
||||
breakdownItems.push(`${matName}: ${numeralWrapper.format(mat.qty * MaterialSizes[matName], "0,0.0")}`);
|
||||
}
|
||||
|
||||
for (const prodName in division.products) {
|
||||
const prod = division.products[prodName];
|
||||
if (prod === undefined) continue;
|
||||
breakdown = (
|
||||
<>
|
||||
{breakdown}
|
||||
{prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, "0,0.0")}
|
||||
</>
|
||||
);
|
||||
breakdownItems.push(`${prodName}: ${numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, "0,0.0")}`);
|
||||
}
|
||||
|
||||
const breakdown = <>{breakdownItems.join('<br />')}</>
|
||||
|
||||
return (
|
||||
<Paper>
|
||||
<Box display="flex" alignItems="center">
|
||||
|
Loading…
Reference in New Issue
Block a user