mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-27 09:25:20 +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
|
let geohash: String
|
||||||
|
|
||||||
@Environment(\.colorScheme) var colorScheme
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
@State private var draft: String = ""
|
@State private var draft: String = ""
|
||||||
|
|
||||||
init(geohash: String) {
|
init(geohash: String) {
|
||||||
@@ -53,6 +54,15 @@ struct LocationNotesView: View {
|
|||||||
.foregroundColor(secondaryTextColor)
|
.foregroundColor(secondaryTextColor)
|
||||||
}
|
}
|
||||||
Spacer()
|
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)
|
.frame(height: 44)
|
||||||
.padding(.horizontal, 12)
|
.padding(.horizontal, 12)
|
||||||
|
|||||||
Reference in New Issue
Block a user