From 58047e8f48df58716866718a678ec4b3b2309e84 Mon Sep 17 00:00:00 2001 From: "emre.kartal" Date: Fri, 2 Feb 2024 23:26:53 +0100 Subject: [PATCH] Begging the daily gift page :hammer: --- Sources/AllInApp/AllIn/ContentView.swift | 8 ++++ .../AllInApp/AllIn/Views/DailyGiftPage.swift | 44 +++++++++++++++++++ .../AllInApp.xcodeproj/project.pbxproj | 4 ++ 3 files changed, 56 insertions(+) create mode 100644 Sources/AllInApp/AllIn/Views/DailyGiftPage.swift diff --git a/Sources/AllInApp/AllIn/ContentView.swift b/Sources/AllInApp/AllIn/ContentView.swift index 29d03fc..34be80a 100644 --- a/Sources/AllInApp/AllIn/ContentView.swift +++ b/Sources/AllInApp/AllIn/ContentView.swift @@ -10,6 +10,7 @@ import DependencyInjection struct ContentView: View { + @State private var show = true @Inject var authService: IAuthService @ObservedObject var loggedState = AppStateContainer.shared.loggedState @@ -30,6 +31,13 @@ struct ContentView: View { .onAppear { authService.refreshAuthentication() } + .overlay( + Group { + if show { + DailyGiftPage(show: $show) + } + } + ) } } diff --git a/Sources/AllInApp/AllIn/Views/DailyGiftPage.swift b/Sources/AllInApp/AllIn/Views/DailyGiftPage.swift new file mode 100644 index 0000000..dfc7a63 --- /dev/null +++ b/Sources/AllInApp/AllIn/Views/DailyGiftPage.swift @@ -0,0 +1,44 @@ +// +// DailyGiftPage.swift +// AllIn +// +// Created by étudiant on 02/02/2024. +// + +import SwiftUI + +struct DailyGiftPage: View { + @Binding var show: Bool + var body: some View { + LinearGradient( + gradient: Gradient(colors: [ + Color.black.opacity(0.5), + Color.black.opacity(0.9) + ]), + startPoint: .top, + endPoint: .bottom + ) + .edgesIgnoringSafeArea(.all) + + VStack{ + Text("Récompense quotidienne") + .font(.title) + .foregroundColor(.white) + .padding() + + Button("Fermer") { + show.toggle() + } + .padding() + .background(Color.blue) + .foregroundColor(.white) + .cornerRadius(10) + } + } +} + +struct DailyGiftPage_Previews: PreviewProvider { + static var previews: some View { + DailyGiftPage(show: .constant(false)) + } +} diff --git a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj index 9d640e0..b3c871e 100644 --- a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj +++ b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ ECB7BC6C2B2F43EE002A6654 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB7BC6B2B2F43EE002A6654 /* AppState.swift */; }; ECB7BC702B336E28002A6654 /* RegisterViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB7BC6F2B336E28002A6654 /* RegisterViewModel.swift */; }; ECCD244A2B4DE8010071FA9E /* Api in Frameworks */ = {isa = PBXBuildFile; productRef = ECCD24492B4DE8010071FA9E /* Api */; }; + ECED90B52B6D9CEC00F50937 /* DailyGiftPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECED90B42B6D9CEC00F50937 /* DailyGiftPage.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -172,6 +173,7 @@ ECB7BC692B2F410A002A6654 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; ECB7BC6B2B2F43EE002A6654 /* AppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = ""; }; ECB7BC6F2B336E28002A6654 /* RegisterViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterViewModel.swift; sourceTree = ""; }; + ECED90B42B6D9CEC00F50937 /* DailyGiftPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DailyGiftPage.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -309,6 +311,7 @@ 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */, 123590B32B51792000F7AEBD /* DetailsView.swift */, 123225D82B67B46100D30BB3 /* BetEndingValidationView.swift */, + ECED90B42B6D9CEC00F50937 /* DailyGiftPage.swift */, ); path = Views; sourceTree = ""; @@ -534,6 +537,7 @@ EC650A4C2B25E9C7003AFCAD /* RankingView.swift in Sources */, EC7A882B2B28D1E0004F226A /* DropDownMenu.swift in Sources */, EC7A882D2B28D8A1004F226A /* CreationBetView.swift in Sources */, + ECED90B52B6D9CEC00F50937 /* DailyGiftPage.swift in Sources */, EC6B96CF2B24B8D900FC1C58 /* Config.swift in Sources */, 1244EF602B4EC31E00374ABF /* HistoricBetView.swift in Sources */, EC30770B2B24D9160060E34D /* WelcomeView.swift in Sources */,