diff --git a/package/contents/ui/lib/helper.js b/package/contents/ui/lib/helper.js index 4984a62..32b19d3 100644 --- a/package/contents/ui/lib/helper.js +++ b/package/contents/ui/lib/helper.js @@ -3,23 +3,17 @@ const colors = [ '#718d00', '#6fa100', '#5c8000', '#498000', '#080' ]; -function batteryColor(batteryPercent) { - return colors[({ - "-2": 9, - "-1": 0 - })[batteryPercent] ?? ~~(batteryPercent / 10 + 0.5) - 1]; -} +const batteryColor = batteryPercent => colors[({ + "-2": 9, + "-1": 0 +})[batteryPercent] ?? ~~(batteryPercent / 10 + 0.5) - 1]; -function batteryLevel(batteryPercent) { - return ({ - "-2": "not connected", - "-1": "charging" - })[batteryPercent] ?? batteryPercent + "%"; -} +const batteryLevel = batteryPercent => ({ + "-2": "not connected", + "-1": "charging" +})[batteryPercent] ?? batteryPercent + "%"; -function batteryIcon(batteryPercent) { - return ({ - "-2": "action-unavailable", - "-1": "battery-ac-adapter" - })[batteryPercent] ?? "audio-headphones-symbolic"; -} +const batteryIcon = batteryPercent => ({ + "-2": "action-unavailable", + "-1": "battery-ac-adapter" +})[batteryPercent] ?? "audio-headphones-symbolic";