mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 04:25:21 +00:00
Location notes: add close (x) button in sheet header (upper-right) using @Environment(\.dismiss)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user