This commit is contained in:
fmodf 2024-07-08 09:41:35 +02:00
parent ce3bc42fbb
commit b3518ea71b
2 changed files with 103 additions and 32 deletions

View file

@ -2,7 +2,53 @@ import SwiftUI
struct AttachmentContactsPickerView: View {
var body: some View {
Text("Contact Picker")
// Implement your contact picker here
VStack(spacing: 0) {
// Contacts list
let rosters = store.state.rostersState.rosters.filter { !$0.locallyDeleted }
if !rosters.isEmpty {
List {
ForEach(rosters) { roster in
ContactRow(roster: roster)
}
}
.listStyle(.plain)
.background(Color.Material.Background.light)
} else {
Spacer()
}
}
}
}
private struct ContactRow: View {
var roster: Roster
var body: some View {
VStack(spacing: 0) {
HStack(spacing: 8) {
ZStack {
Circle()
.frame(width: 44, height: 44)
.foregroundColor(.red)
Text(roster.name?.firstLetter ?? roster.contactBareJid.firstLetter)
.foregroundColor(.white)
.font(.body1)
}
Text(roster.contactBareJid)
.foregroundColor(Color.Material.Text.main)
.font(.body2)
Spacer()
}
.padding(.horizontal, 16)
.padding(.vertical, 4)
Rectangle()
.frame(maxWidth: .infinity)
.frame(height: 1)
.foregroundColor(.Material.Background.dark)
}
.sharedListRow()
.onTapGesture {
print(roster.contactBareJid)
}
}
}

View file

@ -6,6 +6,7 @@ struct AttachmentLocationPickerView: View {
@State private var region = MKCoordinateRegion()
var body: some View {
VStack(spacing: 0) {
ZStack {
// MapView
MapView(region: $region)
@ -41,6 +42,30 @@ struct AttachmentLocationPickerView: View {
}
}
}
// Send panel
Rectangle()
.foregroundColor(.Material.Shape.black)
.frame(maxWidth: .infinity)
.frame(height: 50)
.overlay {
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)
}
.padding()
}
.clipped()
.onTapGesture {
// TODO: Send selected media
print("Send location")
}
}
.onAppear {
locationManager.start()
}