changeset 31:e521236028e0

Remove OK button
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Fri, 23 Jul 2021 13:38:44 +0100
parents f76d0e26c178
children 98ac88c07ee1
files Simoleon/Helpers/CurrencySelector.swift
diffstat 1 files changed, 1 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/Simoleon/Helpers/CurrencySelector.swift	Fri Jul 23 13:19:28 2021 +0100
+++ b/Simoleon/Helpers/CurrencySelector.swift	Fri Jul 23 13:38:44 2021 +0100
@@ -14,23 +14,12 @@
     @EnvironmentObject var subscriptionController: SubscriptionController
     
     @State private var searchCurrency = ""
-    @State private var searching = false
     @State private var showingSubscriptionPaywall = false
     
     var body: some View {
         NavigationView {
             Form {
-                TextField("Search ...", text: $searchCurrency) { startedEditing in
-                if startedEditing {
-                         withAnimation {
-                             searching = true
-                         }
-                     }
-                } onCommit: {
-                    withAnimation {
-                        searching = false
-                    }
-                }
+                TextField("Search ...", text: $searchCurrency)
                 
                 Section(header: Text("All currencies", comment: "Section header in currency selector")) {
                     ForEach(currencyPairs(), id: \.self) { currencyPair in
@@ -43,7 +32,6 @@
             .gesture(DragGesture()
                  .onChanged({ _ in
                     UIApplication.shared.dismissKeyboard()
-                    searching = false
                  })
              )
             .navigationTitle(Text("Currencies", comment: "Navigation title"))
@@ -54,19 +42,6 @@
                         Text("Cancel", comment: "Button to dismiss currency selector")
                     }
                 }
-                
-                ToolbarItem(placement: .confirmationAction) {
-                    if searching {                        
-                        Button(action: { withAnimation {
-                            searchCurrency = ""
-                            searching = false
-                            UIApplication.shared.dismissKeyboard()
-                        }}
-                        ) {
-                            Text("Ok", comment: "Button to stop searching in currency selector")
-                        }
-                     }
-                }
             }
         }
         .sheet(isPresented: $showingSubscriptionPaywall) {