mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
removed images in pills in favour of text decos
FIX fix
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Copyright 2023, 2024 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum PillUtilities {
|
||||
static let atRoom = "@room"
|
||||
static var everyone: String {
|
||||
L10n.commonEveryone
|
||||
}
|
||||
|
||||
/// Used by the WYSIWYG as the urlString value to identify @room mentions
|
||||
static let composerAtRoomURLString = "#"
|
||||
|
||||
/// Used only to mock the max width in previews since the real max width is calculated by the line fragment width
|
||||
static let mockMaxWidth: CGFloat = 235
|
||||
|
||||
private static let roomDecoration = "#"
|
||||
static func roomPillDisplayText(roomName: String?, rawRoomText: String) -> String {
|
||||
guard let roomName else {
|
||||
return rawRoomText
|
||||
}
|
||||
return "\(roomDecoration)\(roomName)"
|
||||
}
|
||||
|
||||
private static let eventDecoration = "💬 > "
|
||||
static func eventPillDisplayText(roomName: String?, rawRoomText: String) -> String {
|
||||
guard let roomName else {
|
||||
return "\(eventDecoration)\(rawRoomText)"
|
||||
}
|
||||
return "\(eventDecoration)\(roomDecoration)\(roomName)"
|
||||
}
|
||||
|
||||
private static let userDecoration = "@"
|
||||
static func userPillDisplayText(username: String?, userID: String) -> String {
|
||||
guard let username else {
|
||||
return userID
|
||||
}
|
||||
return "\(userDecoration)\(username)"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user