You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Session/Media Viewing & Editing/MessageInfoView.swift

89 lines
2.6 KiB
Swift

// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
import SwiftUI
struct MessageInfoView: View {
var actions: [ContextMenuVC.Action]
var messageViewModel: MessageViewModel
var body: some View {
VStack(
alignment: .center,
spacing: 10
) {
// Message bubble snapshot
Image("snapshot")
// TODO: Attachment carousel view
// Message Info
ZStack {
RoundedRectangle(cornerRadius: 8)
VStack(
alignment: .leading,
spacing: 10
) {
VStack(
alignment: .leading
) {
Text("Sent:")
.bold()
Text(messageViewModel.dateForUI.fromattedForMessageInfo)
}
VStack(
alignment: .leading
) {
Text("Received:")
.bold()
Text(messageViewModel.receivedDateForUI.fromattedForMessageInfo)
}
VStack(
alignment: .leading
) {
Text("From:")
.bold()
HStack(
spacing: 5
) {
Image("avatar")
VStack(
alignment: .leading
) {
Text(messageViewModel.authorName)
.bold()
Text(messageViewModel.authorId)
}
}
}
}
}
// Actions
ZStack {
RoundedRectangle(cornerRadius: 8)
VStack {
ForEach(
0...(actions.count - 1),
id: \.self
) { index in
HStack {
Image(uiImage: actions[index].icon!)
Text(actions[index].title)
}
}
}
}
}
}
}
struct MessageInfoView_Previews: PreviewProvider {
static var previews: some View {
MessageInfoView(
actions: [],
messageViewModel: nil)
}
}