mastodon-ios/Mastodon/Extension/MastodonSDK/Mastodon+Entity+Notificatio...

84 lines
2.5 KiB
Swift
Raw Normal View History

2021-04-19 11:00:51 +02:00
//
// Mastodon+Entity+Notification+Type.swift
// Mastodon
//
// Created by sxiaojian on 2021/4/19.
//
import Foundation
import MastodonSDK
import UIKit
import MastodonAsset
import MastodonLocalization
2021-04-19 11:00:51 +02:00
extension Mastodon.Entity.Notification.NotificationType {
public var color: UIColor {
get {
var color: UIColor
switch self {
case .follow:
2022-06-02 11:31:23 +02:00
color = Asset.Colors.brand.color
2021-04-19 11:00:51 +02:00
case .favourite:
color = Asset.Colors.Notification.favourite.color
case .reblog:
color = Asset.Colors.Notification.reblog.color
case .mention:
color = Asset.Colors.Notification.mention.color
case .poll:
2022-06-02 11:31:23 +02:00
color = Asset.Colors.brand.color
case .followRequest:
2022-06-02 11:31:23 +02:00
color = Asset.Colors.brand.color
2021-04-19 11:00:51 +02:00
default:
color = .clear
}
return color
}
}
2021-08-16 08:48:24 +02:00
// public var actionText: String {
// get {
// var actionText: String
// switch self {
// case .follow:
// actionText = L10n.Scene.Notification.Action.follow
// case .favourite:
// actionText = L10n.Scene.Notification.Action.favourite
// case .reblog:
// actionText = L10n.Scene.Notification.Action.reblog
// case .mention:
// actionText = L10n.Scene.Notification.Action.mention
// case .poll:
// actionText = L10n.Scene.Notification.Action.poll
// case .followRequest:
// actionText = L10n.Scene.Notification.Action.followRequest
// default:
// actionText = ""
// }
// return actionText
// }
// }
2021-04-19 11:00:51 +02:00
public var actionImageName: String {
get {
var actionImageName: String
switch self {
case .follow:
actionImageName = "person.crop.circle.badge.checkmark"
case .favourite:
actionImageName = "star.fill"
case .reblog:
actionImageName = "arrow.2.squarepath"
case .mention:
actionImageName = "at"
case .poll:
actionImageName = "list.bullet"
case .followRequest:
actionImageName = "person.crop.circle"
2021-04-19 11:00:51 +02:00
default:
actionImageName = ""
}
return actionImageName
}
}
}