Mercurial > public > simoleon
comparison Simoleon/Helpers/CurrencySelectorLabel.swift @ 185:2fc95efcb1ee
connect backend
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 22 Dec 2021 16:12:23 +0100 |
parents | |
children | 13d5a8deb6c2 |
comparison
equal
deleted
inserted
replaced
184:7cb2b0b2b3f3 | 185:2fc95efcb1ee |
---|---|
1 // | |
2 // CurrencySelectorLabel.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 20/12/21. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct CurrencySelectorLabel: View { | |
11 var currency: SupportedCurrencyResult | |
12 | |
13 var body: some View { | |
14 RoundedRectangle(cornerRadius: 15) | |
15 .foregroundColor(Color(.secondarySystemBackground)) | |
16 .frame(height: 60) | |
17 .overlay( | |
18 HStack { | |
19 let flagName = getFlagName(currency: currency) | |
20 Flag(flagName: flagName) | |
21 Text(currency.code) | |
22 .font(.headline) | |
23 .foregroundColor(.primary) | |
24 .padding(.leading, 5) | |
25 } | |
26 ) | |
27 } | |
28 } | |
29 | |
30 struct CurrencySelectorLabel_Previews: PreviewProvider { | |
31 static var previews: some View { | |
32 CurrencySelectorLabel( | |
33 currency: SupportedCurrencyResult(code: "EUR", name: "Euro", isCrypto: 0) | |
34 ) | |
35 } | |
36 } |