Notifications: fix rocket icon

This commit is contained in:
Thomas Ricouard 2023-02-28 18:48:22 +01:00
parent 9ebe0b314c
commit 54198c877f
3 changed files with 15 additions and 11 deletions

View file

@ -58,7 +58,7 @@ struct NotificationRowView: View {
.background(Circle().foregroundColor(type.tintColor(isPrivate: notification.status?.visibility == .direct))) .background(Circle().foregroundColor(type.tintColor(isPrivate: notification.status?.visibility == .direct)))
.frame(width: 24, height: 24) .frame(width: 24, height: 24)
Image(systemName: type.iconName(isPrivate: notification.status?.visibility == .direct)) type.icon(isPrivate: notification.status?.visibility == .direct)
.resizable() .resizable()
.scaledToFit() .scaledToFit()
.frame(width: 12, height: 12) .frame(width: 12, height: 12)

View file

@ -45,25 +45,25 @@ extension Models.Notification.NotificationType {
} }
} }
func iconName(isPrivate: Bool) -> String { func icon(isPrivate: Bool) -> Image {
if isPrivate { if isPrivate {
return "tray.fill" return Image(systemName:"tray.fill")
} }
switch self { switch self {
case .status: case .status:
return "pencil" return Image(systemName:"pencil")
case .mention: case .mention:
return "at" return Image(systemName:"at")
case .reblog: case .reblog:
return "Rocket.Fill" return Image("Rocket.Fill")
case .follow, .follow_request: case .follow, .follow_request:
return "person.fill.badge.plus" return Image(systemName:"person.fill.badge.plus")
case .favourite: case .favourite:
return "star.fill" return Image(systemName:"star.fill")
case .poll: case .poll:
return "chart.bar.fill" return Image(systemName:"chart.bar.fill")
case .update: case .update:
return "pencil.line" return Image(systemName:"pencil.line")
} }
} }

View file

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