Mercurial > public > simoleon
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Simoleon/UI/SubscriptionFeature.swift Sat Aug 28 11:15:25 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: String + 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: "Favorite Currencies", + description: "Save your favorite currencies to access them quickly." + ) + } +}