mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Space Settings UI tweaks (#4678)
* design tweaks for the space settings flow * pr suggestions * update proj
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user