Space Settings UI tweaks (#4678)

* design tweaks for the space settings flow

* pr suggestions

* update proj
This commit is contained in:
Mauro
2025-10-31 12:52:56 +01:00
committed by GitHub
parent 010500a083
commit dc9ab56972
37 changed files with 187 additions and 40 deletions
@@ -0,0 +1,39 @@
//
// Copyright 2025 New Vector 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
/// A button that contains text that is copied on tap
struct CopyTextButton: View {
let content: String
var body: some View {
Button {
UIPasteboard.general.string = content
} label: {
Label {
Text(content)
.lineLimit(1)
} icon: {
CompoundIcon(\.copy, size: .small, relativeTo: .compound.bodyLG)
.accessibilityHidden(true)
}
.font(.compound.bodyLG)
.foregroundStyle(.compound.textSecondary)
.labelStyle(.custom(spacing: 4, iconLayout: .trailing))
}
.accessibilityHint(L10n.actionCopy)
}
}
struct CopyTextButton_Previews: PreviewProvider, TestablePreview {
static var previews: some View {
CopyTextButton(content: "Copy me!")
.previewLayout(.sizeThatFits)
}
}
@@ -30,6 +30,7 @@ enum TestablePreviewsDictionary {
"CollapsibleRoomTimelineView_Previews" : CollapsibleRoomTimelineView_Previews.self,
"CompletionSuggestion_Previews" : CompletionSuggestion_Previews.self,
"ComposerToolbar_Previews" : ComposerToolbar_Previews.self,
"CopyTextButton_Previews" : CopyTextButton_Previews.self,
"CreateRoom_Previews" : CreateRoom_Previews.self,
"DeactivateAccountScreen_Previews" : DeactivateAccountScreen_Previews.self,
"DeclineAndBlockScreen_Previews" : DeclineAndBlockScreen_Previews.self,