mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
ef26796d98
* Implemented opening the LLS on our own user when tapping on the banner * added a test for moving the map as soon as the first update arrives. * updated preview tests
43 lines
1.5 KiB
Swift
43 lines
1.5 KiB
Swift
//
|
|
// 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 LiveLocationSharingBannerView: View {
|
|
var onTap: () -> Void
|
|
var onStop: () -> Void
|
|
|
|
var body: some View {
|
|
Button { onTap() } label: {
|
|
HStack(spacing: 9) {
|
|
CompoundIcon(\.locationPinSolid, size: .medium, relativeTo: .compound.bodyMDSemibold)
|
|
.foregroundColor(Color.compound.iconSuccessPrimary)
|
|
.accessibilityHidden(true)
|
|
Text(L10n.screenRoomLiveLocationBanner)
|
|
.font(.compound.bodyMDSemibold)
|
|
.foregroundColor(.compound.textPrimary)
|
|
Spacer()
|
|
Button(L10n.actionStop, role: .destructive, action: onStop)
|
|
.buttonStyle(.compound(.primary, size: .small))
|
|
}
|
|
}
|
|
.padding(.vertical, 16)
|
|
.padding(.horizontal, 15)
|
|
.background(Color.compound.bgCanvasDefault)
|
|
.overlay(alignment: .top) { Color.compound.separatorPrimary.frame(height: 1) }
|
|
.overlay(alignment: .bottom) { Color.compound.separatorPrimary.frame(height: 1) }
|
|
}
|
|
}
|
|
|
|
struct LiveLocationSharingBannerView_Previews: PreviewProvider, TestablePreview {
|
|
static var previews: some View {
|
|
LiveLocationSharingBannerView { } onStop: { }
|
|
.previewLayout(.sizeThatFits)
|
|
}
|
|
}
|