status-bar: add titles

This adds titles to interactive elements. This causes a small (browser-
native) tooltip to display when hovering.
This commit is contained in:
David Lechner
2022-02-22 12:32:20 -06:00
parent 109e65b54f
commit b3ed75f02b
3 changed files with 14 additions and 2 deletions
+10 -2
View File
@@ -58,7 +58,11 @@ const HubInfoButton: React.VFC = (_props) => {
</table>
}
>
<Button minimal={true} onMouseDown={(e) => e.preventDefault()}>
<Button
title={i18n.translate(MessageId.HubInfoTitle)}
minimal={true}
onMouseDown={(e) => e.preventDefault()}
>
{deviceName}
</Button>
</Popover2>
@@ -82,7 +86,11 @@ const BatteryIndicator: React.VFC = (_props) => {
</span>
}
>
<div className="pb-battery-indicator" style={{ cursor: 'pointer' }}>
<div
title={i18n.translate(MessageId.BatteryTitle)}
className="pb-battery-indicator"
style={{ cursor: 'pointer' }}
>
<div className="pb-battery-indicator-body">
<ProgressBar
animate={charging}
+2
View File
@@ -1,10 +1,12 @@
{
"hubInfo": {
"title": "Connected hub",
"connectedTo": "Connected to:",
"hubType": "Hub type:",
"firmware": "Firmware:"
},
"battery": {
"title": "Battery",
"low": "Battery is low. Hub will turn off soon.",
"ok": "Battery level is OK."
}
+2
View File
@@ -4,8 +4,10 @@
// Status bar translation keys.
export enum MessageId {
BatteryTitle = 'battery.title',
BatteryLow = 'battery.low',
BatteryOk = 'battery.ok',
HubInfoTitle = 'hubInfo.title',
HubInfoConnectedTo = 'hubInfo.connectedTo',
HubInfoHubType = 'hubInfo.hubType',
HubInfoFirmware = 'hubInfo.firmware',