Fix notification text color

This commit is contained in:
Thomas Ricouard 2023-03-03 09:20:17 +01:00
parent 5766adc965
commit 82179e5f6f
3 changed files with 7 additions and 5 deletions

View file

@ -144,9 +144,9 @@ struct NotificationRowView: View {
StatusRowView(viewModel: { .init(status: status, StatusRowView(viewModel: { .init(status: status,
client: client, client: client,
routerPath: routerPath, routerPath: routerPath,
showActions: false) }) showActions: false,
textDisabled: true) })
.lineLimit(4) .lineLimit(4)
.foregroundColor(.gray)
} }
Spacer() Spacer()
} }

View file

@ -12,6 +12,7 @@ public class StatusRowViewModel: ObservableObject {
let isFocused: Bool let isFocused: Bool
let isRemote: Bool let isRemote: Bool
let showActions: Bool let showActions: Bool
let textDisabled: Bool
let finalStatus: AnyStatus let finalStatus: AnyStatus
@Published var isPinned: Bool @Published var isPinned: Bool
@ -89,7 +90,8 @@ public class StatusRowViewModel: ObservableObject {
routerPath: RouterPath, routerPath: RouterPath,
isFocused: Bool = false, isFocused: Bool = false,
isRemote: Bool = false, isRemote: Bool = false,
showActions: Bool = true) showActions: Bool = true,
textDisabled: Bool = false)
{ {
self.status = status self.status = status
self.finalStatus = status.reblog ?? status self.finalStatus = status.reblog ?? status
@ -98,6 +100,7 @@ public class StatusRowViewModel: ObservableObject {
self.isFocused = isFocused self.isFocused = isFocused
self.isRemote = isRemote self.isRemote = isRemote
self.showActions = showActions self.showActions = showActions
self.textDisabled = textDisabled
if let reblog = status.reblog { if let reblog = status.reblog {
isPinned = reblog.pinned == true isPinned = reblog.pinned == true
} else { } else {

View file

@ -5,7 +5,6 @@ import SwiftUI
struct StatusRowTextView: View { struct StatusRowTextView: View {
@EnvironmentObject private var theme: Theme @EnvironmentObject private var theme: Theme
@EnvironmentObject private var preferences: UserPreferences
@ObservedObject var viewModel: StatusRowViewModel @ObservedObject var viewModel: StatusRowViewModel
@ -17,7 +16,7 @@ struct StatusRowTextView: View {
language: viewModel.finalStatus.language, language: viewModel.finalStatus.language,
lineLimit: viewModel.lineLimit) lineLimit: viewModel.lineLimit)
.font(.scaledBody) .font(.scaledBody)
.foregroundColor(theme.labelColor) .foregroundColor(viewModel.textDisabled ? .gray : theme.labelColor)
.emojiSize(Font.scaledBodyPointSize) .emojiSize(Font.scaledBodyPointSize)
.environment(\.openURL, OpenURLAction { url in .environment(\.openURL, OpenURLAction { url in
viewModel.routerPath.handleStatus(status: viewModel.finalStatus, url: url) viewModel.routerPath.handleStatus(status: viewModel.finalStatus, url: url)