mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Last Owner should edit admins, and not leave when is last (#4372)
This commit is contained in:
+15
-7
@@ -10,9 +10,22 @@ import SwiftUI
|
||||
struct RoomChangeRolesScreenSelectedItem: View {
|
||||
let member: RoomMemberDetails
|
||||
let mediaProvider: MediaProviderProtocol?
|
||||
let dismissAction: () -> Void
|
||||
let dismissAction: (() -> Void)?
|
||||
|
||||
var body: some View {
|
||||
mainContent
|
||||
.accessibilityActions {
|
||||
if let dismissAction {
|
||||
Button(L10n.actionDismiss) {
|
||||
dismissAction()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private var mainContent: some View {
|
||||
VStack(spacing: 4) {
|
||||
avatar
|
||||
|
||||
@@ -22,13 +35,8 @@ struct RoomChangeRolesScreenSelectedItem: View {
|
||||
.lineLimit(1)
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityAction(named: L10n.actionDismiss) {
|
||||
dismissAction()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
var avatar: some View {
|
||||
LoadableAvatarImage(url: member.avatarURL,
|
||||
name: member.name,
|
||||
@@ -37,7 +45,7 @@ struct RoomChangeRolesScreenSelectedItem: View {
|
||||
mediaProvider: mediaProvider)
|
||||
.accessibilityHidden(true)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
if member.role != .administrator {
|
||||
if let dismissAction {
|
||||
Button(action: dismissAction) {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
.resizable()
|
||||
|
||||
Reference in New Issue
Block a user