Invite the DM recipient to a new room (#5588)

* handle the details to invite users flow.

* implemented the room creation in the invite screen, and its dismissal + navigaton to the newly created room

* updated preview and unit tests

* pr suggestions
This commit is contained in:
Mauro
2026-05-18 10:08:07 +02:00
committed by GitHub
parent 9ed47c61b7
commit 6c0aaa7a58
39 changed files with 297 additions and 100 deletions
@@ -12,6 +12,7 @@ import SwiftUI
struct InviteUsersScreenSelectedItem: View {
let user: UserProfileProxy
let mediaProvider: MediaProviderProtocol?
var isLocked = false
let dismissAction: () -> Void
var body: some View {
@@ -25,18 +26,27 @@ struct InviteUsersScreenSelectedItem: View {
.lineLimit(1)
}
.accessibilityElement(children: .combine)
.accessibilityAction(named: L10n.actionRemove, dismissAction)
.accessibilityActions {
if !isLocked {
Button(L10n.actionRemove, action: dismissAction)
}
}
}
// MARK: - Private
@ViewBuilder
var avatar: some View {
LoadableAvatarImage(url: user.avatarURL,
name: user.displayName,
contentID: user.userID,
avatarSize: .user(on: .inviteUsers),
mediaProvider: mediaProvider)
.overlayRemoveItemButton(action: dismissAction)
let avatarImage = LoadableAvatarImage(url: user.avatarURL,
name: user.displayName,
contentID: user.userID,
avatarSize: .user(on: .inviteUsers),
mediaProvider: mediaProvider)
if isLocked {
avatarImage
} else {
avatarImage.overlayRemoveItemButton(action: dismissAction)
}
}
var closeButtonLabel: some View {