From 52933568d79548c1f130473b223ac689737e5ef3 Mon Sep 17 00:00:00 2001 From: jack Date: Sat, 13 Sep 2025 00:55:47 +0200 Subject: [PATCH] Location notes: add close (x) button in sheet header (upper-right) using @Environment(\.dismiss) --- bitchat/Views/LocationNotesView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bitchat/Views/LocationNotesView.swift b/bitchat/Views/LocationNotesView.swift index 56e7b880..7cffb5f1 100644 --- a/bitchat/Views/LocationNotesView.swift +++ b/bitchat/Views/LocationNotesView.swift @@ -6,6 +6,7 @@ struct LocationNotesView: View { let geohash: String @Environment(\.colorScheme) var colorScheme + @Environment(\.dismiss) private var dismiss @State private var draft: String = "" init(geohash: String) { @@ -53,6 +54,15 @@ struct LocationNotesView: View { .foregroundColor(secondaryTextColor) } Spacer() + Button(action: { dismiss() }) { + Image(systemName: "xmark") + .font(.system(size: 13, weight: .semibold, design: .monospaced)) + .foregroundColor(textColor) + .frame(width: 32, height: 32) + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + .accessibilityLabel("Close") } .frame(height: 44) .padding(.horizontal, 12)