Mercurial > public > simoleon
comparison Simoleon/Helpers/Flag.swift @ 187:13d5a8deb6c2
add AboutView and FavoritesView
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Thu, 23 Dec 2021 16:12:22 +0100 |
parents | 2fc95efcb1ee |
children |
comparison
equal
deleted
inserted
replaced
186:1ebd1c5dd302 | 187:13d5a8deb6c2 |
---|---|
6 // | 6 // |
7 | 7 |
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct Flag: View { | 10 struct Flag: View { |
11 var flagName: String | 11 var currencyCode: String |
12 | 12 |
13 var body: some View { | 13 var body: some View { |
14 Image(flagName) | 14 Image(String(currencyCode.dropLast())) |
15 .resizable() | 15 .resizable() |
16 .aspectRatio(contentMode: .fill) | 16 .aspectRatio(contentMode: .fill) |
17 .frame(width: 35, height: 35) | 17 .frame(width: 35, height: 35) |
18 .clipShape(Circle()) | 18 .clipShape(Circle()) |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 struct Flag_Previews: PreviewProvider { | 22 struct Flag_Previews: PreviewProvider { |
23 static var previews: some View { | 23 static var previews: some View { |
24 Flag(flagName: "EU") | 24 Flag(currencyCode: "EUR") |
25 } | 25 } |
26 } | 26 } |