Mercurial > public > simoleon
comparison Simoleon/ConversionView.swift @ 171:70f0625bfcf1
Merge pull request #17 from denniscm190/development
open source project
committer: GitHub <noreply@github.com>
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 12 Oct 2021 16:17:35 +0200 |
parents | 35573bdd7d9b |
children |
comparison
equal
deleted
inserted
replaced
146:f10b0e188905 | 171:70f0625bfcf1 |
---|---|
1 // | |
2 // ConversionView.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 18/07/2021. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct ConversionView: View { | |
11 var showNavigationView: Bool? | |
12 @StateObject var currencyConversion = CurrencyConversion() | |
13 | |
14 var body: some View { | |
15 ScrollView(showsIndicators: false) { | |
16 VStack(alignment: .leading, spacing: 20) { | |
17 HStack { | |
18 CurrencySelector(currencyConversion: currencyConversion) | |
19 FavoriteButton(currencyConversion: currencyConversion) | |
20 } | |
21 | |
22 ConversionBox(currencyConversion: currencyConversion) | |
23 .padding(.top) | |
24 } | |
25 .padding() | |
26 } | |
27 .navigationTitle("Convert") | |
28 .if(UIDevice.current.userInterfaceIdiom == .phone && showNavigationView ?? true) { content in | |
29 NavigationView { content } | |
30 } | |
31 } | |
32 } | |
33 | |
34 | |
35 struct ConversionView_Previews: PreviewProvider { | |
36 static var previews: some View { | |
37 ConversionView(showNavigationView: true) | |
38 } | |
39 } |