Meshtastic-Apple/Meshtastic/Views/Helpers/Help/DirectMessagesHelp.swift

77 lines
1.8 KiB
Swift
Raw Permalink Normal View History

2024-08-15 16:31:58 -07:00
//
// DirectMessagesHelp.swift
// Meshtastic
//
// Copyright Garth Vander Houwen on 8/15/24.
//
import SwiftUI
struct DirectMessagesHelp: View {
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
@Environment(\.dismiss) private var dismiss
var body: some View {
ScrollView {
2024-08-16 07:55:23 -07:00
Label("Direct Message Help", systemImage: "questionmark.circle")
2024-08-15 16:31:58 -07:00
.font(.title)
.padding(.vertical)
VStack(alignment: .leading) {
HStack {
Image(systemName: "star.fill")
.foregroundColor(.yellow)
.padding(.bottom)
Text("Favorites and nodes with recent messages show up at the top of the contact list.")
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
}
HStack {
Image(systemName: "hand.tap")
.padding(.bottom)
Text("Long press to favorite or mute the contact or delete a conversation.")
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
}
}
if idiom == .phone {
VStack(alignment: .leading) {
LockLegend()
AckErrors()
}
} else {
HStack(alignment: .top) {
LockLegend()
AckErrors()
2024-08-15 20:20:59 -07:00
.padding(.trailing)
2024-08-15 16:31:58 -07:00
}
}
#if targetEnvironment(macCatalyst)
Spacer()
Button {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
2024-08-15 16:31:58 -07:00
}
.buttonStyle(.bordered)
.buttonBorderShape(.capsule)
.controlSize(.large)
.padding(.bottom)
#endif
}
.frame(minHeight: 0, maxHeight: .infinity, alignment: .leading)
.padding()
.presentationDetents([.large])
.presentationContentInteraction(.scrolls)
.presentationDragIndicator(.visible)
.presentationBackgroundInteraction(.enabled(upThrough: .large))
}
}
struct DirectMessagesHelpPreviews: PreviewProvider {
static var previews: some View {
VStack {
AckErrors()
}
}
}