mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Implement the SpaceAddRoomsScreen. (#4951)
* Update proxies ready for adding rooms to a space. - ClientProxy.recentlyVisitedRooms to take a filter and to return room proxies. - Expose SpaceServiceProxy.addChildToSpace. * Implement the SpaceAddRoomsScreen. * Fix the designs of the selected carousels. Add more snapshot tests for inviting users. * Fix for screen using wrong avatar size.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright 2026 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
|
||||
|
||||
extension View {
|
||||
func overlayRemoveItemButton(action: @escaping () -> Void) -> some View {
|
||||
modifier(RemoveItemButtonViewModifier(action: action))
|
||||
}
|
||||
}
|
||||
|
||||
private struct RemoveItemButtonViewModifier: ViewModifier {
|
||||
let action: () -> Void
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.mask {
|
||||
Rectangle()
|
||||
.fill(.white)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
closeButtonLabel
|
||||
.hidden()
|
||||
.padding(2)
|
||||
.overlay { Circle().fill(.black) }
|
||||
.offset(x: 2, y: -2)
|
||||
}
|
||||
.compositingGroup()
|
||||
.luminanceToAlpha()
|
||||
}
|
||||
.overlay(alignment: .topTrailing) {
|
||||
Button(action: action) {
|
||||
closeButtonLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var closeButtonLabel: some View {
|
||||
CompoundIcon(\.close, size: .custom(12), relativeTo: .compound.bodySM)
|
||||
.foregroundStyle(.compound.iconOnSolidPrimary)
|
||||
.padding(2)
|
||||
.background(.compound.iconPrimary, in: Circle())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user