Skip to content

Commit a9f2884

Browse files
committed
fix: extract foregroundColor into a property
1 parent 8e7afef commit a9f2884

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Core/Core/Features/Inbox/View/InboxView.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public struct InboxView: View, ScreenViewTrackable {
2222
@ObservedObject private var model: InboxViewModel
2323
@Environment(\.viewController) private var controller
2424
public let screenViewTrackingParameters: ScreenViewTrackingParameters
25+
private let appSpecificForegroundColor = AppEnvironment.shared.app == .horizon ?
26+
.backgroundDarkest :
27+
Color(Brand.shared.navTextColor.ensureContrast(against: Brand.shared.navBackground))
2528

2629
public init(model: InboxViewModel) {
2730
self.model = model
@@ -210,7 +213,7 @@ public struct InboxView: View, ScreenViewTrackable {
210213
} label: {
211214
// TODO: Remove the condition once horizon-specific logic is no longer needed.
212215
Image.hamburgerSolid
213-
.foregroundColor(AppEnvironment.shared.app == .horizon ? .backgroundDarkest : Color(Brand.shared.navTextColor.ensureContrast(against: Brand.shared.navBackground)))
216+
.foregroundColor(appSpecificForegroundColor)
214217
}
215218
.frame(width: 44, height: 44).padding(.leading, -6)
216219
.identifier("Inbox.profileButton")
@@ -223,7 +226,7 @@ public struct InboxView: View, ScreenViewTrackable {
223226
} label: {
224227
Image.addSolid
225228
// TODO: Remove the condition once horizon-specific logic is no longer needed.
226-
.foregroundColor(AppEnvironment.shared.app == .horizon ? .backgroundDarkest : Color(Brand.shared.navTextColor.ensureContrast(against: Brand.shared.navBackground)))
229+
.foregroundColor(appSpecificForegroundColor)
227230
}
228231
.frame(width: 44, height: 44).padding(.trailing, -6)
229232
.identifier("Inbox.newMessageButton")

0 commit comments

Comments
 (0)