Add Legend button under advanced search

This commit is contained in:
maddiebaka
2023-11-17 14:15:27 -05:00
parent 7c4b743061
commit 9f9f4c6409
2 changed files with 29 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ struct DictionaryView: View {
@State private var tokiInput: String = ""
@State private var selectedPartOfSpeech: String?
@State private var showGenericLegend: Bool = false
@State private var advancedSearchEnabled = false
@State var searchMode: SearchMode = .Dictionary
@@ -68,6 +69,13 @@ struct DictionaryView: View {
}
filterByInput()
}
Button(action: {
print("Legend")
showGenericLegend.toggle()
}, label: {
Text("Legend")
})
.padding(4)
}
.padding([.leading, .trailing], 8)
}
@@ -77,6 +85,9 @@ struct DictionaryView: View {
.sheet(item: $selectedPartOfSpeech) { selectedPOS in
PartsOfSpeechView(selectedPartOfSpeech: selectedPOS)
}
.sheet(isPresented: $showGenericLegend, content: {
PartsOfSpeechView(selectedPartOfSpeech: nil)
})
.onChange(of: tokiInput) { newValue in
filterByInput()
//tokiDictViewModel.filterDictionaryEnglishMode(newValue)