[AGS] Battery: Design complete

This commit is contained in:
Janis Hutz 2025-04-26 13:30:22 +02:00
parent 86e963e408
commit 2fd32da1b2

View File

@ -23,6 +23,7 @@ export const BatteryBox = () => {
label={bind(battery, "percentage").as( label={bind(battery, "percentage").as(
p => ` ${Math.round(p * 100)}%`, p => ` ${Math.round(p * 100)}%`,
)} )}
marginEnd={3}
/> />
<label <label
cssClasses={["battery-time"]} cssClasses={["battery-time"]}
@ -47,8 +48,8 @@ const toTime = (time: number) => {
const hours = Math.round(time / HOUR); const hours = Math.round(time / HOUR);
const minutes = Math.round((time - hours * HOUR) / MINUTE); const minutes = Math.round((time - hours * HOUR) / MINUTE);
const hoursDisplay = hours > 0 ? `${hours}h ` : ""; const hoursDisplay = hours > 0 ? `${hours}h` : "";
const minutesDisplay = minutes > 0 ? `${minutes}m ` : ""; const minutesDisplay = minutes > 0 ? `${minutes}m` : "";
return `${hoursDisplay}${minutesDisplay}`; return `${hoursDisplay}${minutesDisplay}`;
}; };