Mercurial > public > simoleon
comparison Simoleon/Helpers/CurrencyRow.swift @ 77:1069c33d3a42
Added new method to show unlocked content
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 31 Jul 2021 17:09:58 +0100 |
parents | b6f8661300f2 |
children | 04feeb708833 |
comparison
equal
deleted
inserted
replaced
76:1f657241c28f | 77:1069c33d3a42 |
---|---|
7 | 7 |
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct CurrencyRow: View { | 10 struct CurrencyRow: View { |
11 var currencyPairName: String | 11 var currencyPairName: String |
12 var isLocked: Bool? | |
12 let currencyMetadata: [String: CurrencyMetadataModel] = parseJson("CurrencyMetadata.json") | 13 let currencyMetadata: [String: CurrencyMetadataModel] = parseJson("CurrencyMetadata.json") |
13 | 14 |
14 var body: some View { | 15 var body: some View { |
15 HStack { | 16 HStack { |
16 let currencies = currencyPairName.split(separator: "/") | 17 let currencies = currencyPairName.split(separator: "/") |
34 .fontWeight(.semibold) | 35 .fontWeight(.semibold) |
35 .foregroundColor(Color("PlainButton")) | 36 .foregroundColor(Color("PlainButton")) |
36 .padding(.leading) | 37 .padding(.leading) |
37 | 38 |
38 Spacer() | 39 Spacer() |
40 | |
41 if isLocked ?? false { | |
42 Image(systemName: "lock") | |
43 .foregroundColor(Color(.systemGray)) | |
44 } | |
39 } | 45 } |
40 } | 46 } |
41 } | 47 } |
42 | 48 |
43 struct CurrencyRow_Previews: PreviewProvider { | 49 struct CurrencyRow_Previews: PreviewProvider { |