Meshtastic-Apple/Meshtastic/Views/Helpers/Messages/MessageTemplate.swift

39 lines
767 B
Swift
Raw Normal View History

2022-09-19 15:47:21 -07:00
//
// MessageTemplate.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 9/18/22.
//
import SwiftUI
struct MessageTemplate: View {
2023-03-06 10:33:18 -08:00
2022-09-19 15:47:21 -07:00
var user: UserEntity
var message: MessageEntity
var messageReply: MessageEntity?
var body: some View {
2023-03-06 10:33:18 -08:00
2022-09-19 15:47:21 -07:00
// Display the message being replied to and the arrow
if message.replyID > 0 {
2023-03-06 10:33:18 -08:00
2022-09-19 15:47:21 -07:00
HStack {
Text(messageReply?.messagePayload ?? "EMPTY MESSAGE").foregroundColor(.blue).font(.caption2)
.padding(10)
.overlay(
RoundedRectangle(cornerRadius: 18)
.stroke(Color.blue, lineWidth: 0.5)
)
Image(systemName: "arrowshape.turn.up.left.fill")
.symbolRenderingMode(.hierarchical)
.imageScale(.large).foregroundColor(.blue)
.padding(.trailing)
}
}
2023-03-06 10:33:18 -08:00
2022-09-19 15:47:21 -07:00
// Message
2023-03-06 10:33:18 -08:00
2022-09-19 15:47:21 -07:00
}
}