Mercurial > public > simoleon
comparison Simoleon/ContentView.swift @ 13:cdc5f728b105
Minor UI updates
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 13 Jul 2021 19:56:33 +0100 |
parents | 81f4e0a3b1eb |
children | 03ce7421c6f4 |
comparison
equal
deleted
inserted
replaced
12:81f4e0a3b1eb | 13:cdc5f728b105 |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 import Alamofire | 9 import Alamofire |
10 | 10 |
11 struct ContentView: View { | 11 struct ContentView: View { |
12 @State private var showingView = false | 12 @State private var showingView = false |
13 | |
14 @State private var text = "" | 13 @State private var text = "" |
15 @State private var isEditing = false | 14 @State private var isEditing = false |
16 | |
17 @State private var popularCurrencyPairsQuote = [CurrencyQuoteModel()] | 15 @State private var popularCurrencyPairsQuote = [CurrencyQuoteModel()] |
18 @State private var popularSelectedCurrencyPairQuote: CurrencyQuoteModel? = nil | 16 @State private var popularSelectedCurrencyPairQuote: CurrencyQuoteModel? = nil |
19 | 17 |
20 let currencyMetadata: [String: CurrencyMetadataModel] = parseJson("CurrencyMetadata.json") | 18 let currencyMetadata: [String: CurrencyMetadataModel] = parseJson("CurrencyMetadata.json") |
21 | 19 |
24 NavigationView { | 22 NavigationView { |
25 ScrollView(showsIndicators: false) { | 23 ScrollView(showsIndicators: false) { |
26 VStack(spacing: 20) { | 24 VStack(spacing: 20) { |
27 SearchBar(text: $text, isEditing: $isEditing) | 25 SearchBar(text: $text, isEditing: $isEditing) |
28 .padding(.vertical) | 26 .padding(.vertical) |
27 .padding(.top) | |
29 | 28 |
30 if text.isEmpty { | 29 if text.isEmpty { |
31 ForEach(popularCurrencyPairsQuote, id: \.self) { currencyQuote in | 30 ForEach(popularCurrencyPairsQuote, id: \.self) { currencyQuote in |
32 CurrencyRow(currencyQuote: currencyQuote) | 31 CurrencyRow(currencyQuote: currencyQuote) |
33 .onTapGesture { self.popularSelectedCurrencyPairQuote = currencyQuote } | 32 .onTapGesture { self.popularSelectedCurrencyPairQuote = currencyQuote } |