Skip to content

Commit

Permalink
Small fixes for phases UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens committed Nov 2, 2023
1 parent 3490ead commit 49ba022
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/Marine2/components/ui/ValueBar/ValueBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const ValueBar = ({ values, prefix, forcePowerUnit, status }: Props) => (
{prefix && (
<div className="mr-3 md:mr-6 text-victron-darkGray dark:text-victron-gray-500 tabular-nums">{prefix}</div>
)}
<div className="flex justify-between grow">
<div className="flex justify-between grow w-full">
{values.map((v, id) => (
<ValueWithUnit
key={id}
value={v.value}
unit={v.unit}
hideDecimal={v.hideDecimal}
forcePowerUnit={forcePowerUnit}
className="md:min-w-[110px] text-black dark:text-victron-gray-600 tabular-nums"
className="text-black dark:text-victron-gray-600 tabular-nums"
status={status}
/>
))}
Expand Down
6 changes: 3 additions & 3 deletions src/app/Marine2/components/ui/ValueWithUnit/ValueWithUnit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ValueWithUnit: FC<Props> = ({
if (status !== "active") {
const getInactiveUnit = () => (unit === "W" || unit === "kW" ? "W" : unit)
return (
<span className={className}>
<span className={`min-w-fit ${className}`}>
--
<Unit unit={getInactiveUnit()} />
</span>
Expand All @@ -36,7 +36,7 @@ export const ValueWithUnit: FC<Props> = ({

if (unit === "W" || unit === "kW") {
return (
<span className={className}>
<span className={`min-w-fit ${className}`}>
{powerValueFor(value, forcePowerUnit)}
<Unit unit={powerUnitFor(value, forcePowerUnit)} />
</span>
Expand All @@ -48,7 +48,7 @@ export const ValueWithUnit: FC<Props> = ({
}

return (
<span className={className}>
<span className={`min-w-fit ${className}`}>
{formatValue(value, hideDecimal ? 0 : 1)}
<Unit unit={unit} />
</span>
Expand Down

0 comments on commit 49ba022

Please sign in to comment.