mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Address PR comments
Add more docs. Rename PhotoPickerPresenter to MediaPickerPresenter. Use a Character for the placeholder avatar rather than a string.
This commit is contained in:
@@ -19,6 +19,6 @@ import UIKit
|
||||
|
||||
enum AvatarViewState {
|
||||
case empty
|
||||
case placeholder(String, Int)
|
||||
case placeholder(Character, Int)
|
||||
case avatar(UIImage)
|
||||
}
|
||||
|
||||
@@ -25,12 +25,9 @@ struct PlaceholderAvatarViewModel {
|
||||
/// The number of total colors available for the `stableColorIndex`.
|
||||
let colorCount: Int
|
||||
|
||||
/// Get the first character of the display name capitalized or else an empty string.
|
||||
var firstCharacterCapitalized: String {
|
||||
guard let character = displayName?.first else {
|
||||
return ""
|
||||
}
|
||||
return String(character).capitalized
|
||||
/// Get the first character of the display name capitalized or else a space character.
|
||||
var firstCharacterCapitalized: Character {
|
||||
return displayName?.capitalized.first ?? " "
|
||||
}
|
||||
|
||||
/// Provides the same color each time for a specified matrixId
|
||||
|
||||
Reference in New Issue
Block a user