Better visibility for DM in notifications list close #1064

This commit is contained in:
Thomas Ricouard 2023-02-25 18:12:31 +01:00
parent b036e90ce4
commit d82453c513
4 changed files with 13 additions and 6 deletions

View File

@ -184,7 +184,7 @@ public struct ExploreView: View {
Section("explore.section.trending.posts") {
ForEach(viewModel.trendingStatuses
.prefix(upTo: viewModel.trendingStatuses.count > 3 ? 3 : viewModel.trendingStatuses.count)) { status in
StatusRowView(viewModel: { .init(status: status, client: client, routerPath: routerPath) })
StatusRowView(viewModel: { .init(status: status, client: client, routerPath: routerPath) })
.listRowBackground(theme.primaryBackgroundColor)
.padding(.vertical, 8)
}

View File

@ -55,11 +55,12 @@ struct NotificationRowView: View {
ZStack(alignment: .center) {
Circle()
.strokeBorder(Color.white, lineWidth: 1)
.background(Circle().foregroundColor(type.tintColor()))
.background(Circle().foregroundColor(type.tintColor(isPrivate: notification.status?.visibility == .priv)))
.frame(width: 24, height: 24)
Image(systemName: type.iconName())
Image(systemName: type.iconName(isPrivate: notification.status?.visibility == .priv))
.resizable()
.scaledToFit()
.frame(width: 12, height: 12)
.foregroundColor(.white)
}

View File

@ -45,7 +45,10 @@ extension Models.Notification.NotificationType {
}
}
func iconName() -> String {
func iconName(isPrivate: Bool) -> String {
if isPrivate {
return "tray.fill"
}
switch self {
case .status:
return "pencil"
@ -64,7 +67,10 @@ extension Models.Notification.NotificationType {
}
}
func tintColor() -> Color {
func tintColor(isPrivate: Bool) -> Color {
if isPrivate {
return Color.orange.opacity(0.80)
}
switch self {
case .status, .mention, .update, .poll:
return Theme.shared.tintColor.opacity(0.80)

View File

@ -43,7 +43,7 @@ public struct NotificationsListView: View {
Button {
viewModel.selectedType = type
} label: {
Label(type.menuTitle(), systemImage: type.iconName())
Label(type.menuTitle(), systemImage: type.iconName(isPrivate: false))
}
}
}