comparison Simoleon/UI/SubscriptionPaywall.swift @ 156:84137052813d

Refactor code
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Sat, 28 Aug 2021 11:15:25 +0100
parents Simoleon/SubscriptionPaywall.swift@fd19def1ce3f
children
comparison
equal deleted inserted replaced
155:681f2cbe8c7f 156:84137052813d
1 //
2 // SubscriptionPaywall.swift
3 // Simoleon
4 //
5 // Created by Dennis Concepción Martín on 22/07/2021.
6 //
7
8 import SwiftUI
9
10 struct SubscriptionPaywall: View {
11 @Binding var showingSubscriptionPaywall: Bool
12
13 var body: some View {
14 NavigationView {
15 ScrollView {
16 VStack(alignment: .leading, spacing: 20) {
17 HStack {
18 Spacer()
19 VStack {
20 Image("Subscription")
21 .resizable()
22 .aspectRatio(contentMode: .fit)
23 .frame(width: 100, height: 100)
24 .cornerRadius(25)
25 .padding(.top)
26
27 Text("Unlock All Access")
28 .font(.title)
29 .fontWeight(.semibold)
30 .fixedSize(horizontal: false, vertical: true)
31 .multilineTextAlignment(.center)
32 .padding(.top)
33 }
34
35 Spacer()
36 }
37
38 Divider()
39
40 SubscriptionFeature(
41 symbol: "star.circle.fill",
42 colour: Color(.systemYellow),
43 title: "Favorite Forex Pairs",
44 description: "Save any currency pair to access them quickly."
45 )
46
47 SubscriptionFeature(
48 symbol: "flag.circle.fill",
49 colour: Color(.systemRed),
50 title: "Over 170 Currencies",
51 description: "Access almost every currency of the world."
52 )
53
54 SubscriptionFeature(
55 symbol: "icloud.circle.fill",
56 colour: Color(.systemBlue),
57 title: "Everything is Up-to-date",
58 description: "Your settings and favorite currencies in all your devices."
59 )
60
61 SubscriptionFeature(
62 symbol: "bitcoinsign.circle.fill",
63 colour: Color(.systemOrange),
64 title: "Cryptos and Commodities",
65 description: "Convert currency between cryptos, gold, and silver."
66 )
67
68 Spacer()
69 SubscribeButton(showingSubscriptionPaywall: $showingSubscriptionPaywall)
70 HStack {
71 Spacer()
72 RestoreButton(showingSubscriptionPaywall: $showingSubscriptionPaywall)
73 Spacer()
74 }
75 }
76 .padding(.bottom)
77 .padding(.horizontal, 40)
78 }
79 .navigationBarTitleDisplayMode(.inline)
80 .toolbar {
81 ToolbarItem(placement: .cancellationAction) {
82 Button(action: { showingSubscriptionPaywall = false }) {
83 Text("Cancel")
84 }
85 }
86 }
87 }
88 }
89 }
90
91 struct SubscriptionPaywall_Previews: PreviewProvider {
92 static var previews: some View {
93 SubscriptionPaywall(showingSubscriptionPaywall: .constant(true))
94 }
95 }