conversations-classic-ios/ConversationsClassic/View/Screens/Attachments/AttachmentLocationPickerView.swift

49 lines
1.5 KiB
Swift
Raw Normal View History

2024-07-04 14:25:25 +00:00
import Combine
2024-07-04 11:45:39 +00:00
import CoreLocation
2024-07-02 09:56:27 +00:00
import MapKit
import SwiftUI
struct AttachmentLocationPickerView: View {
2024-07-04 14:25:25 +00:00
@State var region = MKCoordinateRegion()
2024-07-02 09:56:27 +00:00
var body: some View {
2024-07-04 15:01:30 +00:00
VStack(spacing: 0) {
// Map
Map(
coordinateRegion: $region,
interactionModes: .all,
showsUserLocation: false,
userTrackingMode: .constant(.follow)
)
.overlay {
Image(systemName: "mappin")
.font(.system(size: 30))
.foregroundColor(.Material.Elements.active)
}
// Send panel
Rectangle()
.foregroundColor(.Material.Shape.black)
.frame(maxWidth: .infinity)
.frame(height: 50)
2024-07-04 14:38:00 +00:00
.overlay {
2024-07-04 15:01:30 +00:00
HStack {
Text(L10n.Attachment.Send.location)
.foregroundColor(.Material.Text.white)
.font(.body1)
Image(systemName: "arrow.up.circle")
.foregroundColor(.Material.Text.white)
.font(.body1)
.padding(.leading, 8)
2024-07-04 12:55:47 +00:00
}
2024-07-04 15:01:30 +00:00
.padding()
}
.clipped()
.onTapGesture {
// TODO: Send location
print("Send location")
2024-07-04 12:55:47 +00:00
}
2024-07-04 13:40:32 +00:00
}
2024-07-02 09:56:27 +00:00
}
}