Skip to content

Commit 4b2cb51

Browse files
committed
Add color for lastRestart key
1 parent 48779ea commit 4b2cb51

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

SupportCompanion/Components/CardData.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct CardData: View {
4949
case Constants.Battery.Keys.health:
5050
healthContent(value: value)
5151
case Constants.DeviceInfo.Keys.lastRestart:
52-
daysContent(value: value, suffix: " \(Constants.General.days)")
52+
daysContent(value: value, suffix: " \(Constants.General.days)", color: colorForValue(key: key, value: value))
5353
case "FileVault":
5454
fileVaultContent(value: value)
5555
case Constants.KerberosSSO.Keys.expiryDays:
@@ -142,7 +142,14 @@ struct CardData: View {
142142
}
143143
case "LastRestart":
144144
if let intValue = value.rawValue as? Int {
145-
return intValue > 7 ? (colorScheme == .light ? .redLight : .red) : .ScGreen
145+
switch intValue {
146+
case 0...2:
147+
return .ScGreen
148+
case 3...7:
149+
return colorScheme == .light ? .orangeLight : .orange
150+
default:
151+
return colorScheme == .light ? .redLight : .red
152+
}
146153
}
147154
case "FileVault":
148155
if let boolValue = value.rawValue as? Bool {

0 commit comments

Comments
 (0)