Mercurial > public > simoleon
comparison Simoleon/UI/SubscriptionFeature.swift @ 156:84137052813d
Refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 28 Aug 2021 11:15:25 +0100 |
parents | Simoleon/Helpers/SubscriptionFeature.swift@4082787b33e5 |
children |
comparison
equal
deleted
inserted
replaced
155:681f2cbe8c7f | 156:84137052813d |
---|---|
1 // | |
2 // SubscriptionFeature.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 26/07/2021. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct SubscriptionFeature: View { | |
11 var symbol: String | |
12 var colour: Color | |
13 var title: LocalizedStringKey | |
14 var description: LocalizedStringKey | |
15 | |
16 var body: some View { | |
17 HStack(alignment:.top) { | |
18 Image(systemName: symbol) | |
19 .foregroundColor(colour) | |
20 .font(.title) | |
21 | |
22 VStack(alignment: .leading) { | |
23 Text(title) | |
24 .font(.headline) | |
25 | |
26 Text(description) | |
27 } | |
28 } | |
29 } | |
30 } | |
31 | |
32 struct SubscriptionFeature_Previews: PreviewProvider { | |
33 static var previews: some View { | |
34 SubscriptionFeature( | |
35 symbol: "star.circle.fill", | |
36 colour: Color(.systemYellow), | |
37 title: "Favorite Currencies", | |
38 description: "Save your favorite currencies to access them quickly." | |
39 ) | |
40 } | |
41 } |