2023-01-04 07:14:37 +00:00
|
|
|
import Models
|
2023-01-19 17:14:08 +00:00
|
|
|
import SwiftUI
|
2023-01-04 07:14:37 +00:00
|
|
|
|
|
|
|
extension Models.Notification.NotificationType {
|
2023-01-19 17:14:08 +00:00
|
|
|
func label() -> LocalizedStringKey {
|
2023-01-04 07:14:37 +00:00
|
|
|
switch self {
|
|
|
|
case .status:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.status"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .mention:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.mention"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .reblog:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.reblog"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .follow:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.follow"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .follow_request:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.follow-request"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .favourite:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.favorite"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .poll:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.label.poll"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .update:
|
2023-01-19 17:14:08 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
2023-01-19 17:14:08 +00:00
|
|
|
|
|
|
|
func menuTitle() -> LocalizedStringKey {
|
2023-01-04 07:14:37 +00:00
|
|
|
switch self {
|
|
|
|
case .status:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.status"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .mention:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.mention"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .reblog:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.reblog"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .follow:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.follow"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .follow_request:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.follow-request"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .favourite:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.favorite"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .poll:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.poll"
|
2023-01-04 07:14:37 +00:00
|
|
|
case .update:
|
2023-01-19 17:14:08 +00:00
|
|
|
return "notifications.menu-title.update"
|
2023-01-04 07:14:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|