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

@ -91,6 +91,16 @@
} }
} }
}, },
"Legend" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Légende"
}
}
}
},
"Lessons" : { "Lessons" : {
"localizations" : { "localizations" : {
"fr" : { "fr" : {
@ -162,7 +172,14 @@
} }
}, },
"Words" : { "Words" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Mots"
}
}
}
} }
}, },
"version" : "1.0" "version" : "1.0"

View File

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