mirror of
https://github.com/yattee/yattee.git
synced 2025-11-01 05:02:03 +00:00
Implement trending view actions across platforms
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TrendingCountrySelectionView: View {
|
||||
@State private var query: String = ""
|
||||
|
||||
@ObservedObject private var store = Store<[Country]>()
|
||||
@Binding var selectedCountry: Country
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var body: some View {
|
||||
ScrollView(.vertical) {
|
||||
ForEach(store.collection) { country in
|
||||
Button(country.name) {
|
||||
selectedCountry = country
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
.frame(width: 800)
|
||||
}
|
||||
.searchable(text: $query, prompt: Text("Country name or two letter code"))
|
||||
.onChange(of: query) { newQuery in
|
||||
store.replace(Country.search(newQuery))
|
||||
}
|
||||
.background(.thinMaterial)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user