From 7fbdc2c20fa31784f1cb48d0142a6d40eaf321ca Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:58:17 +0100 Subject: [PATCH] Use the same UI as Android when tapping a link to a private room. (#3044) * Use the same UI as Android when tapping a link to a private room. * Fix preview of knocking. * Fix snapshots. --- .../Screens/JoinRoomScreen/JoinRoomScreenModels.swift | 8 ++++++++ .../Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift | 9 +++++++-- .../Screens/JoinRoomScreen/View/JoinRoomScreen.swift | 6 ++++-- ElementX/Sources/Services/Client/ClientProxy.swift | 2 ++ .../Sources/Services/Client/ClientProxyProtocol.swift | 1 + .../test_joinRoomScreen-iPad-en-GB.Invite.png | 4 ++-- .../PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png | 4 ++-- .../test_joinRoomScreen-iPad-en-GB.Knock.png | 4 ++-- .../test_joinRoomScreen-iPad-en-GB.Unknown.png | 4 ++-- .../test_joinRoomScreen-iPad-pseudo.Invite.png | 4 ++-- .../test_joinRoomScreen-iPad-pseudo.Join.png | 4 ++-- .../test_joinRoomScreen-iPad-pseudo.Knock.png | 4 ++-- .../test_joinRoomScreen-iPad-pseudo.Unknown.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-en-GB.Invite.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-en-GB.Join.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-en-GB.Knock.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-pseudo.Invite.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-pseudo.Join.png | 4 ++-- .../test_joinRoomScreen-iPhone-15-pseudo.Knock.png | 4 ++-- 19 files changed, 50 insertions(+), 32 deletions(-) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index d712bf4478..a29f63aac1 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -43,6 +43,14 @@ struct JoinRoomScreenViewState: BindableState { roomDetails?.name ?? L10n.screenJoinRoomTitleNoPreview } + var subtitle: String? { + switch mode { + case .loading: nil + case .unknown: L10n.screenJoinRoomSubtitleNoPreview + case .invited, .join, .knock: roomDetails?.canonicalAlias + } + } + var avatar: RoomAvatar { .room(id: roomID, name: title, avatarURL: roomDetails?.avatarURL) } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index 78b41cfbe7..8000b19960 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -22,6 +22,7 @@ typealias JoinRoomScreenViewModelType = StateStoreViewModel