Expand iOS messaging shell actions
This commit is contained in:
@@ -230,6 +230,20 @@ public struct ChatDetailView: View {
|
||||
VStack(spacing: 0) {
|
||||
List(viewModel.messages) { message in
|
||||
MessageRow(message: message)
|
||||
.contextMenu {
|
||||
Button("Reply") {
|
||||
viewModel.beginReply(to: message)
|
||||
}
|
||||
Button("React") {
|
||||
Task { await viewModel.react(message: message, reaction: "👍") }
|
||||
}
|
||||
Button("Copy") {
|
||||
Task { await viewModel.copyPayload(for: message) }
|
||||
}
|
||||
Button("Delete", role: .destructive) {
|
||||
Task { await viewModel.delete(message: message) }
|
||||
}
|
||||
}
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
ComposeBar(text: $viewModel.composeText) {
|
||||
@@ -237,6 +251,10 @@ public struct ChatDetailView: View {
|
||||
}
|
||||
}
|
||||
.navigationTitle(viewModel.chat.title)
|
||||
.searchable(text: $viewModel.searchText)
|
||||
.onSubmit(of: .search) {
|
||||
Task { await viewModel.search() }
|
||||
}
|
||||
.toolbar {
|
||||
Button("Profile") {
|
||||
showsProfile = true
|
||||
@@ -303,6 +321,14 @@ public struct ComposeBar: View {
|
||||
|
||||
public var body: some View {
|
||||
HStack(spacing: 10) {
|
||||
if !text.isEmpty {
|
||||
Button {
|
||||
text = ""
|
||||
} label: {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
TextField("Message", text: $text, axis: .vertical)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.lineLimit(1...5)
|
||||
|
||||
Reference in New Issue
Block a user