IceCubesApp/Packages/Notifications/Sources/Notifications/NotificationTypeExt.swift

66 lines
1.6 KiB
Swift
Raw Normal View History

2023-01-04 07:14:37 +00:00
import Models
import SwiftUI
2023-01-04 07:14:37 +00:00
extension Models.Notification.NotificationType {
func label() -> LocalizedStringKey {
2023-01-04 07:14:37 +00:00
switch self {
case .status:
return "notifications.label.status"
2023-01-04 07:14:37 +00:00
case .mention:
return "notifications.label.mention"
2023-01-04 07:14:37 +00:00
case .reblog:
return "notifications.label.reblog"
2023-01-04 07:14:37 +00:00
case .follow:
return "notifications.label.follow"
2023-01-04 07:14:37 +00:00
case .follow_request:
return "notifications.label.follow-request"
2023-01-04 07:14:37 +00:00
case .favourite:
return "notifications.label.favorite"
2023-01-04 07:14:37 +00:00
case .poll:
return "notifications.label.poll"
2023-01-04 07:14:37 +00:00
case .update:
return "notifications.label.update"
2023-01-04 07:14:37 +00:00
}
}
2023-01-17 10:36:01 +00:00
2023-01-04 07:14:37 +00:00
func iconName() -> String {
switch self {
case .status:
return "pencil"
case .mention:
return "at"
case .reblog:
return "arrow.left.arrow.right.circle.fill"
case .follow, .follow_request:
return "person.fill.badge.plus"
case .favourite:
return "star.fill"
case .poll:
return "chart.bar.fill"
case .update:
return "pencil.line"
}
}
func menuTitle() -> LocalizedStringKey {
2023-01-04 07:14:37 +00:00
switch self {
case .status:
return "notifications.menu-title.status"
2023-01-04 07:14:37 +00:00
case .mention:
return "notifications.menu-title.mention"
2023-01-04 07:14:37 +00:00
case .reblog:
return "notifications.menu-title.reblog"
2023-01-04 07:14:37 +00:00
case .follow:
return "notifications.menu-title.follow"
2023-01-04 07:14:37 +00:00
case .follow_request:
return "notifications.menu-title.follow-request"
2023-01-04 07:14:37 +00:00
case .favourite:
return "notifications.menu-title.favorite"
2023-01-04 07:14:37 +00:00
case .poll:
return "notifications.menu-title.poll"
2023-01-04 07:14:37 +00:00
case .update:
return "notifications.menu-title.update"
2023-01-04 07:14:37 +00:00
}
}
}