mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Removing unused code
This commit is contained in:
parent
fc7f6bca0a
commit
1a2f02e589
@ -10,86 +10,6 @@ import SwiftUI
|
||||
|
||||
// TODO: all strings need localization
|
||||
|
||||
extension Mastodon.Entity.NotificationType {
|
||||
|
||||
|
||||
func actionSummaryLabel(firstAuthor: AuthorName, totalAuthorCount: Int)
|
||||
-> AttributedString
|
||||
{
|
||||
// TODO: L10n strings
|
||||
switch firstAuthor {
|
||||
case .me:
|
||||
assert(totalAuthorCount == 1)
|
||||
assert(self == .poll)
|
||||
return "Your poll has ended"
|
||||
case .other(let firstAuthorName):
|
||||
let nameComponent = boldedNameStringComponent(firstAuthorName)
|
||||
var composedString: AttributedString
|
||||
if totalAuthorCount == 1 {
|
||||
switch self {
|
||||
case .favourite:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" favorited:")
|
||||
case .follow:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" followed you")
|
||||
case .followRequest:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(" requested to follow you")
|
||||
case .reblog:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" boosted:")
|
||||
case .mention:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" mentioned you:")
|
||||
case .poll:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(" ran a poll that you voted in") // TODO: add count of how many others voted
|
||||
case .status:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" posted:")
|
||||
case .adminSignUp:
|
||||
composedString =
|
||||
nameComponent + AttributedString(" signed up")
|
||||
default:
|
||||
composedString =
|
||||
nameComponent + AttributedString("did something?")
|
||||
}
|
||||
} else {
|
||||
switch self {
|
||||
case .favourite:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(
|
||||
" and \(totalAuthorCount - 1) others favorited:")
|
||||
case .follow:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(
|
||||
" and \(totalAuthorCount - 1) others followed you")
|
||||
case .reblog:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(
|
||||
" and \(totalAuthorCount - 1) others boosted:")
|
||||
default:
|
||||
composedString =
|
||||
nameComponent
|
||||
+ AttributedString(
|
||||
" and \(totalAuthorCount - 1) others did something")
|
||||
}
|
||||
}
|
||||
let nameStyling = AttributeContainer.font(
|
||||
.system(.body, weight: .bold))
|
||||
let nameContainer = AttributeContainer.personNameComponent(
|
||||
.givenName)
|
||||
composedString.replaceAttributes(nameContainer, with: nameStyling)
|
||||
return composedString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum AuthorName {
|
||||
case me
|
||||
|
Loading…
x
Reference in New Issue
Block a user