From ec6906a5c3f0e28d4ae986ba39f8ad2b11a6200e Mon Sep 17 00:00:00 2001 From: Tilen Komel Date: Fri, 24 Jan 2025 01:27:33 +0100 Subject: [PATCH] Fixes by hand --- src/components/PageComponents/Config/Bluetooth.tsx | 2 +- src/components/PageComponents/Map/NodeDetail.tsx | 4 ++-- src/components/Sidebar.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/PageComponents/Config/Bluetooth.tsx b/src/components/PageComponents/Config/Bluetooth.tsx index 47eeeca4..a9a92a69 100644 --- a/src/components/PageComponents/Config/Bluetooth.tsx +++ b/src/components/PageComponents/Config/Bluetooth.tsx @@ -10,7 +10,7 @@ export const Bluetooth = (): JSX.Element => { useState(); const bluetoothPinChangeEvent = (e: React.ChangeEvent) => { - if (e.target.value[0] == "0") { + if (e.target.value[0] === "0") { setBluetoothValidationText("Bluetooth Pin cannot start with 0."); } else { setBluetoothValidationText(""); diff --git a/src/components/PageComponents/Map/NodeDetail.tsx b/src/components/PageComponents/Map/NodeDetail.tsx index 00847150..f464ecef 100644 --- a/src/components/PageComponents/Map/NodeDetail.tsx +++ b/src/components/PageComponents/Map/NodeDetail.tsx @@ -84,7 +84,7 @@ export const NodeDetail = ({ node }: NodeDetailProps): JSX.Element => { {node.deviceMetrics?.batteryLevel > 100 ? "Charging" - : node.deviceMetrics?.batteryLevel + "%"} + : `${node.deviceMetrics?.batteryLevel}%`} )} @@ -121,7 +121,7 @@ export const NodeDetail = ({ node }: NodeDetailProps): JSX.Element => {
- {isNaN(node.hopsAway) ? "?" : node.hopsAway} + {Number.isNaN(node.hopsAway) ? "?" : node.hopsAway}
{node.hopsAway === 1 ? "Hop" : "Hops"}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index d4ada2bd..2c4f1963 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -91,7 +91,7 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => { {myNode?.deviceMetrics?.batteryLevel ? myNode?.deviceMetrics?.batteryLevel > 100 ? "Charging" - : myNode?.deviceMetrics?.batteryLevel + "%" + : `${myNode?.deviceMetrics?.batteryLevel}%` : "UNK"}