UI update for advanced search options, search button
This commit is contained in:
@@ -15,22 +15,24 @@ struct TranslatorView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
// Button(action: changeTranslationDirection) {
|
||||
// #warning("This needs to actually switch how the lookup happens")
|
||||
// if translateToTokiPona == true {
|
||||
// LanguageDirectionView(from: "English", to: "Toki Pona", fromColor: .blue, toColor: .cyan)
|
||||
// } else {
|
||||
// LanguageDirectionView(from: "Toki Pona", to: "English", fromColor: .cyan, toColor: .blue)
|
||||
// }
|
||||
// }
|
||||
TextField("Enter Toki Pona Word or Phrase", text: $tokiInput)
|
||||
.multilineTextAlignment(.center)
|
||||
.textInputAutocapitalization(.never)
|
||||
.disableAutocorrection(true)
|
||||
.padding(8)
|
||||
.onSubmit {
|
||||
HStack {
|
||||
TextField("Enter Toki Pona Word or Phrase", text: $tokiInput)
|
||||
.textInputAutocapitalization(.never)
|
||||
.disableAutocorrection(true)
|
||||
.padding(8)
|
||||
.onSubmit {
|
||||
tokiDictViewModel.translatePhrase(tokiInput)
|
||||
}
|
||||
Button {
|
||||
hideKeyboard()
|
||||
tokiDictViewModel.translatePhrase(tokiInput)
|
||||
} label: {
|
||||
Image(systemName: "magnifyingglass")
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.padding([.top, .leading, .trailing], 8)
|
||||
|
||||
if tokiInput.count == 0 {
|
||||
List(tokiDictViewModel.dictionary, id: \.word) { entry in
|
||||
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: $selectedPartOfSpeech)
|
||||
|
||||
Reference in New Issue
Block a user