Mercurial > public > simoleon
comparison Simoleon/UI/CurrencyRow.swift @ 156:84137052813d
Refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 28 Aug 2021 11:15:25 +0100 |
parents | |
children | 1940db1ef321 |
comparison
equal
deleted
inserted
replaced
155:681f2cbe8c7f | 156:84137052813d |
---|---|
1 // | |
2 // CurrencyRow.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 15/07/2021. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct CurrencyRow: View { | |
11 var currency: CurrencyModel | |
12 | |
13 var body: some View { | |
14 HStack { | |
15 Flag(flag: currency.flag) | |
16 VStack(alignment: .leading) { | |
17 Text(currency.symbol) | |
18 .font(.headline) | |
19 | |
20 Text(currency.name) | |
21 .font(.subheadline) | |
22 .lineLimit(1) | |
23 } | |
24 .padding(.horizontal) | |
25 } | |
26 } | |
27 } | |
28 | |
29 struct CurrencyRow_Previews: PreviewProvider { | |
30 static var previews: some View { | |
31 CurrencyRow( | |
32 currency: | |
33 CurrencyModel( | |
34 symbol: "USD", | |
35 name: "United States Dollar", | |
36 flag: "US", | |
37 isCrypto: false | |
38 ) | |
39 ) | |
40 } | |
41 } |