comparison Simoleon/ContentView.swift @ 14:03ce7421c6f4

Minor UI updates
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Wed, 14 Jul 2021 10:06:37 +0100
parents cdc5f728b105
children a02f463aa906
comparison
equal deleted inserted replaced
13:cdc5f728b105 14:03ce7421c6f4
19 19
20 var body: some View { 20 var body: some View {
21 if showingView { 21 if showingView {
22 NavigationView { 22 NavigationView {
23 ScrollView(showsIndicators: false) { 23 ScrollView(showsIndicators: false) {
24 VStack(spacing: 20) { 24 VStack(spacing: 30) {
25 SearchBar(text: $text, isEditing: $isEditing) 25 SearchBar(text: $text, isEditing: $isEditing)
26 .padding(.vertical)
27 .padding(.top) 26 .padding(.top)
28 27
29 if text.isEmpty { 28 if text.isEmpty {
30 ForEach(popularCurrencyPairsQuote, id: \.self) { currencyQuote in 29 ForEach(popularCurrencyPairsQuote, id: \.self) { currencyQuote in
31 CurrencyRow(currencyQuote: currencyQuote) 30 CurrencyRow(currencyQuote: currencyQuote)
32 .onTapGesture { self.popularSelectedCurrencyPairQuote = currencyQuote } 31 .onTapGesture { self.popularSelectedCurrencyPairQuote = currencyQuote }
33 .padding(.bottom)
34 } 32 }
35 } else { 33 } else {
36 SearchedCurrencyList(text: $text) 34 SearchedCurrencyList(text: $text)
37 } 35 }
38 } 36 }
37 .padding(.vertical)
39 .sheet(item: self.$popularSelectedCurrencyPairQuote) { currencyQuote in 38 .sheet(item: self.$popularSelectedCurrencyPairQuote) { currencyQuote in
40 CurrencyConversion(currencyQuote: currencyQuote) 39 CurrencyConversion(currencyQuote: currencyQuote)
41 } 40 }
42 } 41 }
43 .navigationTitle("Simoleon") 42 .navigationTitle("Simoleon")
89 } 88 }
90 89
91 90
92 struct ContentView_Previews: PreviewProvider { 91 struct ContentView_Previews: PreviewProvider {
93 static var previews: some View { 92 static var previews: some View {
94 ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) 93 ContentView()
94 .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
95 } 95 }
96 } 96 }