Meshtastic-Apple/Meshtastic/Views/Helpers/NodeAnnotation.swift
Garth Vander Houwen bd92aae2eb * Add unknown time logic to pins on node details view
* send current position if fixed position is enabled on position config
* check for nil loRaConfig on share channel view
2022-09-05 18:32:27 -07:00

41 lines
841 B
Swift

import Foundation
import SwiftUI
struct NodeAnnotation: View {
let time: Date
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
var body: some View {
if (time >= sixMonthsAgo!) {
VStack(spacing: 0) {
Text(time, style: .offset)
.font(.caption2).foregroundColor(.accentColor)
.padding(5)
.background(Color(.white))
.cornerRadius(10)
}
} else {
VStack(spacing: 0) {
Text("Unknown Time")
.font(.caption2).foregroundColor(.accentColor)
.padding(5)
.background(Color(.white))
.cornerRadius(10)
}
}
Image(systemName: "mappin.circle.fill")
.font(.largeTitle)
.foregroundColor(.accentColor)
Image(systemName: "arrowtriangle.down.fill")
.font(.caption)
.foregroundColor(.accentColor)
.offset(x: 0, y: -5)
}
}