mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Some random tweaks made on a train 🚆 (#4636)
* Fix the search text field's tint colour. * Don't allow optional content IDs in the placeholder avatar. * Use SwiftUI to resolve the hex values in the Inspector app. This fixes incorrect values being shown in dark/high-contrast modes. * Fix a layout bug with the colour swatch in the Inspector app on iPhone. * Switch to the chats tab when selecting a room with the global search screen. * Run the latest SwiftFormat.
This commit is contained in:
@@ -12,7 +12,7 @@ struct PlaceholderAvatarImage: View {
|
||||
@Environment(\.redactionReasons) private var redactionReasons
|
||||
|
||||
private let textForImage: String
|
||||
private let contentID: String?
|
||||
private let contentID: String
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
@@ -32,9 +32,9 @@ struct PlaceholderAvatarImage: View {
|
||||
.aspectRatio(1, contentMode: .fill)
|
||||
}
|
||||
|
||||
init(name: String?, contentID: String?) {
|
||||
let baseName = name ?? contentID?.trimmingCharacters(in: .punctuationCharacters)
|
||||
textForImage = baseName?.first?.uppercased() ?? ""
|
||||
init(name: String?, contentID: String) {
|
||||
let baseName = name ?? contentID.trimmingCharacters(in: .punctuationCharacters)
|
||||
textForImage = baseName.first?.uppercased() ?? ""
|
||||
self.contentID = contentID
|
||||
}
|
||||
|
||||
@@ -47,11 +47,7 @@ struct PlaceholderAvatarImage: View {
|
||||
}
|
||||
|
||||
private var avatarColor: DecorativeColor? {
|
||||
guard let contentID else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return Color.compound.decorativeColor(for: contentID)
|
||||
Color.compound.decorativeColor(for: contentID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user