Skip to content

Commit 01f6024

Browse files
committed
color network antenna icon for wifi quality
1 parent aa5730c commit 01f6024

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

interface/src/framework/network/NetworkStatusForm.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ const networkStatusHighlight = ({ status }: NetworkStatus, theme: Theme) => {
3838
}
3939
};
4040

41+
const networkQualityHighlight = ({ rssi }: NetworkStatus, theme: Theme) => {
42+
if (rssi <= -85) {
43+
return theme.palette.error.main;
44+
} else if (rssi <= -75) {
45+
return theme.palette.warning.main;
46+
}
47+
return theme.palette.success.main;
48+
};
49+
4150
export const isWiFi = ({ status }: NetworkStatus) => status === NetworkConnectionStatus.WIFI_STATUS_CONNECTED;
4251
export const isEthernet = ({ status }: NetworkStatus) => status === NetworkConnectionStatus.ETHERNET_STATUS_CONNECTED;
4352

@@ -110,7 +119,7 @@ const NetworkStatusForm: FC = () => {
110119
<>
111120
<ListItem>
112121
<ListItemAvatar>
113-
<Avatar>
122+
<Avatar sx={{ bgcolor: networkQualityHighlight(data, theme) }}>
114123
<SettingsInputAntennaIcon />
115124
</Avatar>
116125
</ListItemAvatar>

0 commit comments

Comments
 (0)