mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
implemented the UI to manage authorized spaces
This commit is contained in:
@@ -138,6 +138,7 @@ enum RoomAvatarSizeOnScreen {
|
||||
case chats
|
||||
case spaces
|
||||
case spaceSettings
|
||||
case authorizedSpaces
|
||||
case timeline
|
||||
case leaveSpace
|
||||
case messageForwarding
|
||||
@@ -154,14 +155,11 @@ enum RoomAvatarSizeOnScreen {
|
||||
switch self {
|
||||
case .chats, .spaces, .spaceSettings:
|
||||
return 52
|
||||
case .timeline, .leaveSpace:
|
||||
case .timeline, .leaveSpace, .roomDirectorySearch,
|
||||
.completionSuggestions, .authorizedSpaces:
|
||||
return 32
|
||||
case .notificationSettings:
|
||||
return 30
|
||||
case .roomDirectorySearch:
|
||||
return 32
|
||||
case .completionSuggestions:
|
||||
return 32
|
||||
case .messageForwarding:
|
||||
return 36
|
||||
case .globalSearch:
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright 2025 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct ToolbarButton: View {
|
||||
enum Role {
|
||||
case cancel
|
||||
case done
|
||||
|
||||
var title: String {
|
||||
switch self {
|
||||
case .cancel:
|
||||
L10n.actionCancel
|
||||
case .done:
|
||||
L10n.actionDone
|
||||
}
|
||||
}
|
||||
|
||||
var icon: CompoundIcon {
|
||||
switch self {
|
||||
case .cancel:
|
||||
CompoundIcon(\.close)
|
||||
case .done:
|
||||
CompoundIcon(\.check)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let role: Role
|
||||
let action: () -> Void
|
||||
|
||||
var body: some View {
|
||||
if #available(iOS 26, *) {
|
||||
Button(action: action) {
|
||||
role.icon
|
||||
.accessibilityLabel(role.title)
|
||||
}
|
||||
} else {
|
||||
Button(role.title, action: action)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user