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,
client: client,
routerPath: routerPath,
showActions: false) })
showActions: false,
textDisabled: true) })
.lineLimit(4)
.foregroundColor(.gray)
}
Spacer()
}

View file

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

View file

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