diff Simoleon/Helpers/SubscriptionFeature.swift @ 46:ce4eb7416b41

Add SubscriptionFeatureRow
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Mon, 26 Jul 2021 18:25:03 +0100
parents
children b0bce2c8e4a9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Simoleon/Helpers/SubscriptionFeature.swift	Mon Jul 26 18:25:03 2021 +0100
@@ -0,0 +1,41 @@
+//
+//  SubscriptionFeature.swift
+//  Simoleon
+//
+//  Created by Dennis Concepción Martín on 26/07/2021.
+//
+
+import SwiftUI
+
+struct SubscriptionFeature: View {
+    var symbol: LocalizedStringKey
+    var colour: Color
+    var title: LocalizedStringKey
+    var description: LocalizedStringKey
+    
+    var body: some View {
+        HStack(alignment:.top) {
+            Image(systemName: "\(symbol)")
+                .foregroundColor(colour)
+                .font(.title)
+            
+            VStack(alignment: .leading) {
+                Text(title)
+                    .font(.headline)
+                
+                Text(description)
+            }
+        }
+    }
+}
+
+struct SubscriptionFeature_Previews: PreviewProvider {
+    static var previews: some View {
+        SubscriptionFeature(
+            symbol: "star.circle.fill",
+            colour: Color(.systemYellow),
+            title: "Favourite currencies",
+            description: "Save your favourite currencies to access them quickly."
+        )
+    }
+}