comparison GeoQuiz/ContentView.swift @ 16:1011e56b7832

implement user profile
author Dennis C. M. <dennis@denniscm.com>
date Thu, 20 Oct 2022 13:49:42 +0200
parents 136928bae534
children f140bb277c96
comparison
equal deleted inserted replaced
15:f1967f8cc67b 16:1011e56b7832
33 33
34 Button { 34 Button {
35 path.append(.guessTheFlag) 35 path.append(.guessTheFlag)
36 } label: { 36 } label: {
37 GameButton( 37 GameButton(
38 gradient: .main, 38 gradient: GuessTheFlagInfo.gradient,
39 level: "Level 1", 39 level: GuessTheFlagInfo.level,
40 symbol: "flag.fill", 40 symbol: GuessTheFlagInfo.symbol,
41 name: "Guess the flag" 41 name: GuessTheFlagInfo.name
42 ) 42 )
43 } 43 }
44 44
45 Button { 45 Button {
46 if storeKitRC.isActive { 46 if storeKitRC.isActive {
48 } else { 48 } else {
49 showingBuyPremiumModalView = true 49 showingBuyPremiumModalView = true
50 } 50 }
51 } label: { 51 } label: {
52 GameButton( 52 GameButton(
53 gradient: .secondary, 53 gradient: GuessTheCapitalInfo.gradient,
54 level: "Level 2", 54 level: GuessTheCapitalInfo.level,
55 symbol: storeKitRC.isActive ? "building.2.fill": "lock.fill", 55 symbol: storeKitRC.isActive ? GuessTheCapitalInfo.symbol: "lock.fill",
56 name: "Guess the capital" 56 name: GuessTheCapitalInfo.name
57 ) 57 )
58 } 58 }
59 59
60 Button { 60 Button {
61 if storeKitRC.isActive { 61 if storeKitRC.isActive {
63 } else { 63 } else {
64 showingBuyPremiumModalView = true 64 showingBuyPremiumModalView = true
65 } 65 }
66 } label: { 66 } label: {
67 GameButton( 67 GameButton(
68 gradient: .tertiary, 68 gradient: GuessTheCountryInfo.gradient,
69 level: "Level 3", 69 level: GuessTheCountryInfo.level,
70 symbol: storeKitRC.isActive ? "globe.americas.fill": "lock.fill", 70 symbol: storeKitRC.isActive ? GuessTheCountryInfo.symbol: "lock.fill",
71 name: "Guess the country" 71 name: GuessTheCountryInfo.name
72 ) 72 )
73 } 73 }
74 74
75 Button { 75 Button {
76 if storeKitRC.isActive { 76 if storeKitRC.isActive {
78 } else { 78 } else {
79 showingBuyPremiumModalView = true 79 showingBuyPremiumModalView = true
80 } 80 }
81 } label: { 81 } label: {
82 GameButton( 82 GameButton(
83 gradient: .quaternary, 83 gradient: GuessThePopulationInfo.gradient,
84 level: "Level 4", 84 level: GuessThePopulationInfo.level,
85 symbol: storeKitRC.isActive ? "person.fill": "lock.fill", 85 symbol: storeKitRC.isActive ? GuessThePopulationInfo.symbol: "lock.fill",
86 name: "Guess the population" 86 name: GuessThePopulationInfo.name
87 ) 87 )
88 } 88 }
89 89
90 } 90 }
91 .padding() 91 .padding()
148 } 148 }
149 149
150 struct ContentView_Previews: PreviewProvider { 150 struct ContentView_Previews: PreviewProvider {
151 static var previews: some View { 151 static var previews: some View {
152 ContentView() 152 ContentView()
153 .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
153 } 154 }
154 } 155 }