DM Design Tweaks (#3693)

* dm design tweaks

* adding equatable conformance

* topic will now be shown in DMs

* code suggestion

* updated details

* better check

* code improvement
This commit is contained in:
Mauro
2025-01-22 14:32:39 +01:00
committed by GitHub
parent f194285250
commit 48e530fec9
16 changed files with 69 additions and 38 deletions
@@ -37,7 +37,14 @@ struct AvatarHeaderView<Footer: View>: View {
@ViewBuilder footer: @escaping () -> Footer) {
avatarInfo = .room(room.avatar)
title = room.name ?? room.id
subtitle = room.canonicalAlias
if let roomAlias = room.canonicalAlias {
subtitle = roomAlias
} else if room.isDirect, case let .heroes(heroes) = room.avatar, heroes.count == 1 {
subtitle = heroes[0].userID
} else {
subtitle = nil
}
self.avatarSize = avatarSize
self.mediaProvider = mediaProvider
@@ -193,7 +200,8 @@ struct AvatarHeaderView_Previews: PreviewProvider, TestablePreview {
avatarURL: .mockMXCAvatar),
canonicalAlias: "#test:matrix.org",
isEncrypted: true,
isPublic: true),
isPublic: true,
isDirect: false),
avatarSize: .room(on: .details),
mediaProvider: MediaProviderMock(configuration: .init())) {
HStack(spacing: 32) {