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:
Doug
2022-03-21 11:42:58 +00:00
parent 3a12162c5d
commit 052c8ba24a
18 changed files with 84 additions and 48 deletions
@@ -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