Mercurial > public > geoquiz
comparison GeoQuiz/ContentView.swift @ 11:039b26a99a48
implementing RevenueCat
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sun, 09 Oct 2022 17:02:34 +0200 |
parents | a793f33f05fb |
children | bdfff35dd43c |
comparison
equal
deleted
inserted
replaced
10:a793f33f05fb | 11:039b26a99a48 |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct ContentView: View { | 10 struct ContentView: View { |
11 @State private var showingBuyPremiumModalView = false | 11 @State private var showingBuyPremiumModalView = false |
12 @State private var showingSettingsModalView = false | 12 @State private var showingSettingsModalView = false |
13 @State private var showingProfileModalView = false | |
13 | 14 |
14 var body: some View { | 15 var body: some View { |
15 NavigationView { | 16 NavigationView { |
16 ScrollView(showsIndicators: false) { | 17 ScrollView(showsIndicators: false) { |
17 VStack(alignment: .leading, spacing: 20) { | 18 VStack(alignment: .leading, spacing: 30) { |
18 | |
19 Text("Select a game 🎮") | 19 Text("Select a game 🎮") |
20 .font(.largeTitle.bold()) | 20 .font(.largeTitle.bold()) |
21 .padding(.bottom) | 21 .padding(.bottom) |
22 | 22 |
23 NavigationLink(destination: GuessTheFlagView()) { | 23 NavigationLink(destination: GuessTheFlagView()) { |
31 GameButton( | 31 GameButton( |
32 gradient: .secondary, | 32 gradient: .secondary, |
33 level: "Level 2", symbol: "building.2.fill", name: "Guess the capital" | 33 level: "Level 2", symbol: "building.2.fill", name: "Guess the capital" |
34 ) | 34 ) |
35 } | 35 } |
36 | 36 |
37 NavigationLink(destination: GuessTheCountryView()) { | 37 NavigationLink(destination: GuessTheCountryView()) { |
38 GameButton( | 38 GameButton( |
39 gradient: .tertiary, | 39 gradient: .tertiary, |
40 level: "Level 3", symbol: "globe.americas.fill", name: "Guess the country" | 40 level: "Level 3", symbol: "globe.americas.fill", name: "Guess the country" |
41 ) | 41 ) |
65 Button { | 65 Button { |
66 showingBuyPremiumModalView = true | 66 showingBuyPremiumModalView = true |
67 } label: { | 67 } label: { |
68 Label("Buy premium", systemImage: "star") | 68 Label("Buy premium", systemImage: "star") |
69 } | 69 } |
70 | |
71 Button { | |
72 showingProfileModalView = true | |
73 } label: { | |
74 Label("Profile", systemImage: "person") | |
75 } | |
70 } | 76 } |
71 } | 77 } |
72 .sheet(isPresented: $showingBuyPremiumModalView) { | 78 .sheet(isPresented: $showingBuyPremiumModalView) { |
73 Text("Buy premium") | 79 BuyPremiumModalView() |
74 } | 80 } |
75 | 81 |
76 .sheet(isPresented: $showingSettingsModalView) { | 82 .sheet(isPresented: $showingSettingsModalView) { |
77 SettingsModalView() | 83 SettingsModalView() |
84 } | |
85 | |
86 .sheet(isPresented: $showingProfileModalView) { | |
87 ProfileModalView() | |
78 } | 88 } |
79 } | 89 } |
80 .navigationViewStyle(StackNavigationViewStyle()) | 90 .navigationViewStyle(StackNavigationViewStyle()) |
81 } | 91 } |
82 } | 92 } |