diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 3076d2a..6a2535f 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -34,6 +34,23 @@ C4A47DB32B86387500ADC637 /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4A47DB22B86387500ADC637 /* AccountView.swift */; }; FF2BE4872B85E27400592328 /* LeStorage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C425D4542B6D24E2002A7B48 /* LeStorage.framework */; }; FF2BE4882B85E27400592328 /* LeStorage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C425D4542B6D24E2002A7B48 /* LeStorage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + FF3F74F62B919E45004CFE0E /* UmpireView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3F74F52B919E45004CFE0E /* UmpireView.swift */; }; + FF3F74FF2B91A2D4004CFE0E /* AgendaDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3F74FE2B91A2D4004CFE0E /* AgendaDestination.swift */; }; + FF59FFB32B90EFAC0061EFF9 /* EventListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */; }; + FF59FFB72B90EFBF0061EFF9 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF59FFB62B90EFBF0061EFF9 /* MainView.swift */; }; + FF59FFB92B90EFD70061EFF9 /* ToolboxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF59FFB82B90EFD70061EFF9 /* ToolboxView.swift */; }; + FF7091622B90F04300AB08DA /* TournamentOrganizerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7091612B90F04300AB08DA /* TournamentOrganizerView.swift */; }; + FF7091662B90F0B000AB08DA /* NavigationDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7091652B90F0B000AB08DA /* NavigationDestination.swift */; }; + FF7091682B90F79F00AB08DA /* TournamentCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7091672B90F79F00AB08DA /* TournamentCellView.swift */; }; + FF70916A2B90F95E00AB08DA /* DateBoxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7091692B90F95E00AB08DA /* DateBoxView.swift */; }; + FF70916C2B91005400AB08DA /* TournamentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF70916B2B91005400AB08DA /* TournamentView.swift */; }; + FF70916E2B9108C600AB08DA /* InscriptionManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF70916D2B9108C600AB08DA /* InscriptionManagerView.swift */; }; + FF82CFC52B911F5B00B0CAF2 /* OrganizedTournamentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF82CFC42B911F5B00B0CAF2 /* OrganizedTournamentView.swift */; }; + FF82CFC92B9132AF00B0CAF2 /* ActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF82CFC82B9132AF00B0CAF2 /* ActivityView.swift */; }; + FFD783FD2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */; }; + FFD783FF2B91BA42000F62A6 /* PadelClubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD783FE2B91BA42000F62A6 /* PadelClubView.swift */; }; + FFD784022B91C1B4000F62A6 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD784012B91C1B4000F62A6 /* WelcomeView.swift */; }; + FFD784042B91C280000F62A6 /* EmptyActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD784032B91C280000F62A6 /* EmptyActivityView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -111,6 +128,24 @@ C4A47DAC2B85FCCD00ADC637 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; C4A47DB02B86375E00ADC637 /* MainUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainUserView.swift; sourceTree = ""; }; C4A47DB22B86387500ADC637 /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = ""; }; + FF3F74F52B919E45004CFE0E /* UmpireView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UmpireView.swift; sourceTree = ""; }; + FF3F74FE2B91A2D4004CFE0E /* AgendaDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgendaDestination.swift; sourceTree = ""; }; + FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListView.swift; sourceTree = ""; }; + FF59FFB62B90EFBF0061EFF9 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; + FF59FFB82B90EFD70061EFF9 /* ToolboxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolboxView.swift; sourceTree = ""; }; + FF7091612B90F04300AB08DA /* TournamentOrganizerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentOrganizerView.swift; sourceTree = ""; }; + FF7091652B90F0B000AB08DA /* NavigationDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationDestination.swift; sourceTree = ""; }; + FF7091672B90F79F00AB08DA /* TournamentCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentCellView.swift; sourceTree = ""; }; + FF7091692B90F95E00AB08DA /* DateBoxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateBoxView.swift; sourceTree = ""; }; + FF70916B2B91005400AB08DA /* TournamentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentView.swift; sourceTree = ""; }; + FF70916D2B9108C600AB08DA /* InscriptionManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InscriptionManagerView.swift; sourceTree = ""; }; + FF82CFC42B911F5B00B0CAF2 /* OrganizedTournamentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganizedTournamentView.swift; sourceTree = ""; }; + FF82CFC82B9132AF00B0CAF2 /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = ""; }; + FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgendaDestinationPickerView.swift; sourceTree = ""; }; + FFD783FE2B91BA42000F62A6 /* PadelClubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PadelClubView.swift; sourceTree = ""; }; + FFD784002B91BF79000F62A6 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; + FFD784012B91C1B4000F62A6 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = ""; }; + FFD784032B91C280000F62A6 /* EmptyActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyActivityView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -165,6 +200,8 @@ children = ( C425D44E2B6D24E1002A7B48 /* LeStorage.xcodeproj */, C425D4002B6D249D002A7B48 /* PadelClubApp.swift */, + FFD784002B91BF79000F62A6 /* Launch Screen.storyboard */, + FF3F74FD2B91A087004CFE0E /* Model */, C4A47D722B72881500ADC637 /* Views */, C4A47D5F2B6D3B2D00ADC637 /* Data */, C425D4042B6D249E002A7B48 /* Assets.xcassets */, @@ -228,11 +265,13 @@ C4A47D722B72881500ADC637 /* Views */ = { isa = PBXGroup; children = ( - C4A47DA02B7D0BD800ADC637 /* Components */, + FF39719B2B8DE04B004C4E75 /* Navigation */, + FF3F74F72B919F96004CFE0E /* Tournament */, C4A47D882B7BBB5000ADC637 /* Subscription */, C4A47D852B7BA33F00ADC637 /* User */, C425D4022B6D249D002A7B48 /* ContentView.swift */, C4A47D732B72881F00ADC637 /* ClubView.swift */, + C4A47DA02B7D0BD800ADC637 /* Components */, ); path = Views; sourceTree = ""; @@ -279,6 +318,92 @@ path = Components; sourceTree = ""; }; + FF39719B2B8DE04B004C4E75 /* Navigation */ = { + isa = PBXGroup; + children = ( + FF59FFB62B90EFBF0061EFF9 /* MainView.swift */, + FFD783FE2B91BA42000F62A6 /* PadelClubView.swift */, + FFD784012B91C1B4000F62A6 /* WelcomeView.swift */, + FFD783FB2B91B919000F62A6 /* Agenda */, + FF3F74FA2B91A04B004CFE0E /* Organizer */, + FF3F74FB2B91A060004CFE0E /* Toolbox */, + FF3F74FC2B91A06B004CFE0E /* Umpire */, + ); + path = Navigation; + sourceTree = ""; + }; + FF3F74F72B919F96004CFE0E /* Tournament */ = { + isa = PBXGroup; + children = ( + FF70916B2B91005400AB08DA /* TournamentView.swift */, + FF3F74F92B91A018004CFE0E /* Screen */, + FF3F74F82B919FB2004CFE0E /* Shared */, + ); + path = Tournament; + sourceTree = ""; + }; + FF3F74F82B919FB2004CFE0E /* Shared */ = { + isa = PBXGroup; + children = ( + FF7091672B90F79F00AB08DA /* TournamentCellView.swift */, + FF7091692B90F95E00AB08DA /* DateBoxView.swift */, + ); + path = Shared; + sourceTree = ""; + }; + FF3F74F92B91A018004CFE0E /* Screen */ = { + isa = PBXGroup; + children = ( + FF70916D2B9108C600AB08DA /* InscriptionManagerView.swift */, + ); + path = Screen; + sourceTree = ""; + }; + FF3F74FA2B91A04B004CFE0E /* Organizer */ = { + isa = PBXGroup; + children = ( + FF7091612B90F04300AB08DA /* TournamentOrganizerView.swift */, + FF82CFC42B911F5B00B0CAF2 /* OrganizedTournamentView.swift */, + ); + path = Organizer; + sourceTree = ""; + }; + FF3F74FB2B91A060004CFE0E /* Toolbox */ = { + isa = PBXGroup; + children = ( + FF59FFB82B90EFD70061EFF9 /* ToolboxView.swift */, + ); + path = Toolbox; + sourceTree = ""; + }; + FF3F74FC2B91A06B004CFE0E /* Umpire */ = { + isa = PBXGroup; + children = ( + FF3F74F52B919E45004CFE0E /* UmpireView.swift */, + ); + path = Umpire; + sourceTree = ""; + }; + FF3F74FD2B91A087004CFE0E /* Model */ = { + isa = PBXGroup; + children = ( + FF7091652B90F0B000AB08DA /* NavigationDestination.swift */, + ); + path = Model; + sourceTree = ""; + }; + FFD783FB2B91B919000F62A6 /* Agenda */ = { + isa = PBXGroup; + children = ( + FF82CFC82B9132AF00B0CAF2 /* ActivityView.swift */, + FFD784032B91C280000F62A6 /* EmptyActivityView.swift */, + FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */, + FF3F74FE2B91A2D4004CFE0E /* AgendaDestination.swift */, + FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */, + ); + path = Agenda; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -434,24 +559,41 @@ buildActionMask = 2147483647; files = ( C4A47D872B7BA36D00ADC637 /* UserCreationView.swift in Sources */, + FF7091662B90F0B000AB08DA /* NavigationDestination.swift in Sources */, C4A47D9F2B7D0BCE00ADC637 /* StepperView.swift in Sources */, C4A47D8A2B7BBB6500ADC637 /* SubscriptionView.swift in Sources */, C4A47DB12B86375E00ADC637 /* MainUserView.swift in Sources */, + FF7091682B90F79F00AB08DA /* TournamentCellView.swift in Sources */, C4A47DB32B86387500ADC637 /* AccountView.swift in Sources */, + FFD783FD2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift in Sources */, C4A47DA92B85F82100ADC637 /* ChangePasswordView.swift in Sources */, + FF70916C2B91005400AB08DA /* TournamentView.swift in Sources */, + FF7091622B90F04300AB08DA /* TournamentOrganizerView.swift in Sources */, C4A47D742B72881F00ADC637 /* ClubView.swift in Sources */, C4A47D902B7BBBEC00ADC637 /* StoreManager.swift in Sources */, C4A47D5A2B6D383C00ADC637 /* Tournament.swift in Sources */, C4A47D7B2B73C0F900ADC637 /* TournamentV2.swift in Sources */, C4A47D5E2B6D38EC00ADC637 /* DataStore.swift in Sources */, + FF82CFC52B911F5B00B0CAF2 /* OrganizedTournamentView.swift in Sources */, + FF59FFB32B90EFAC0061EFF9 /* EventListView.swift in Sources */, C4A47D7D2B73CDC300ADC637 /* ClubV1.swift in Sources */, + FF3F74FF2B91A2D4004CFE0E /* AgendaDestination.swift in Sources */, C4A47D632B6D3D6500ADC637 /* Club.swift in Sources */, + FF59FFB92B90EFD70061EFF9 /* ToolboxView.swift in Sources */, + FF70916E2B9108C600AB08DA /* InscriptionManagerView.swift in Sources */, + FF82CFC92B9132AF00B0CAF2 /* ActivityView.swift in Sources */, C425D4032B6D249D002A7B48 /* ContentView.swift in Sources */, + FFD783FF2B91BA42000F62A6 /* PadelClubView.swift in Sources */, C425D4012B6D249D002A7B48 /* PadelClubApp.swift in Sources */, + FFD784042B91C280000F62A6 /* EmptyActivityView.swift in Sources */, + FF3F74F62B919E45004CFE0E /* UmpireView.swift in Sources */, C4A47D772B73789100ADC637 /* TournamentV1.swift in Sources */, C4A47DAD2B85FCCD00ADC637 /* User.swift in Sources */, + FF59FFB72B90EFBF0061EFF9 /* MainView.swift in Sources */, + FFD784022B91C1B4000F62A6 /* WelcomeView.swift in Sources */, C4A47D922B7BBBEC00ADC637 /* StoreItem.swift in Sources */, C4A47DA62B83948E00ADC637 /* LoginView.swift in Sources */, + FF70916A2B90F95E00AB08DA /* DateBoxView.swift in Sources */, C4A47D912B7BBBEC00ADC637 /* Guard.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -621,7 +763,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( @@ -650,7 +792,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/PadelClub/Assets.xcassets/AppIcon.appiconset/Contents.json b/PadelClub/Assets.xcassets/AppIcon.appiconset/Contents.json index 13613e3..d3822de 100644 --- a/PadelClub/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/PadelClub/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,6 +1,7 @@ { "images" : [ { + "filename" : "PadelClub_icone.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/PadelClub/Assets.xcassets/AppIcon.appiconset/PadelClub_icone.png b/PadelClub/Assets.xcassets/AppIcon.appiconset/PadelClub_icone.png new file mode 100644 index 0000000..a4016b5 Binary files /dev/null and b/PadelClub/Assets.xcassets/AppIcon.appiconset/PadelClub_icone.png differ diff --git a/PadelClub/Assets.xcassets/LaunchScreenBackground.colorset/Contents.json b/PadelClub/Assets.xcassets/LaunchScreenBackground.colorset/Contents.json new file mode 100644 index 0000000..71f9a84 --- /dev/null +++ b/PadelClub/Assets.xcassets/LaunchScreenBackground.colorset/Contents.json @@ -0,0 +1,353 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal" + }, + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "fr" + }, + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "light" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "58", + "green" : "35", + "red" : "25" + } + }, + "idiom" : "universal", + "locale" : "en" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "localizable" : true + } +} diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/Contents.json b/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/Contents.json new file mode 100644 index 0000000..52c21a3 --- /dev/null +++ b/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "PadelClub_logo_fondclair_transparent.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/PadelClub_logo_fondclair_transparent.png b/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/PadelClub_logo_fondclair_transparent.png new file mode 100644 index 0000000..f26571c Binary files /dev/null and b/PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/PadelClub_logo_fondclair_transparent.png differ diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/Contents.json b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/Contents.json new file mode 100644 index 0000000..69173e8 --- /dev/null +++ b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "PadelClub_logo_fondfonce.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/PadelClub_logo_fondfonce.png b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/PadelClub_logo_fondfonce.png new file mode 100644 index 0000000..0f56ea7 Binary files /dev/null and b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/PadelClub_logo_fondfonce.png differ diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/Contents.json b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/Contents.json new file mode 100644 index 0000000..3d1d421 --- /dev/null +++ b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "PadelClub_logo_fondfonce_transparent.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/PadelClub_logo_fondfonce_transparent.png b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/PadelClub_logo_fondfonce_transparent.png new file mode 100644 index 0000000..018ab3d Binary files /dev/null and b/PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/PadelClub_logo_fondfonce_transparent.png differ diff --git a/PadelClub/Assets.xcassets/logo.imageset/Contents.json b/PadelClub/Assets.xcassets/logo.imageset/Contents.json new file mode 100644 index 0000000..507b1e7 --- /dev/null +++ b/PadelClub/Assets.xcassets/logo.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "PadelClub_small.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PadelClub/Assets.xcassets/logo.imageset/PadelClub_small.png b/PadelClub/Assets.xcassets/logo.imageset/PadelClub_small.png new file mode 100644 index 0000000..a3f62ad Binary files /dev/null and b/PadelClub/Assets.xcassets/logo.imageset/PadelClub_small.png differ diff --git a/PadelClub/Data/DataStore.swift b/PadelClub/Data/DataStore.swift index 2f600f8..69b3ff3 100644 --- a/PadelClub/Data/DataStore.swift +++ b/PadelClub/Data/DataStore.swift @@ -12,6 +12,8 @@ import SwiftUI class DataStore: ObservableObject { // fileprivate var _store: Store + static let shared = DataStore() + fileprivate(set) var tournaments: StoredCollection fileprivate(set) var clubs: StoredCollection @@ -22,6 +24,15 @@ class DataStore: ObservableObject { return self._userStorage.item } + static let fakeTournaments: [Tournament] = [ + Tournament(name: "P100", club_id: "", category: 0, playerCount: 16), + Tournament(name: "P250", club_id: "", category: 0, playerCount: 24), + Tournament(name: "P25", club_id: "", category: 0, playerCount: 4), + Tournament(name: "P1000", club_id: "", category: 0, playerCount: 8), + Tournament(name: "P500", club_id: "", category: 0, playerCount: 48), + ] + + func setUser(_ user: User?) { self._userStorage.item = user } diff --git a/PadelClub/Data/Tournament.swift b/PadelClub/Data/Tournament.swift index c157166..e476743 100644 --- a/PadelClub/Data/Tournament.swift +++ b/PadelClub/Data/Tournament.swift @@ -8,7 +8,16 @@ import Foundation import LeStorage -class Tournament : ModelObject, Storable { +@Observable +class Tournament : ModelObject, Storable, Hashable { + static func == (lhs: Tournament, rhs: Tournament) -> Bool { + lhs.id == rhs.id + } + + func hash(into hasher: inout Hasher) { + return hasher.combine(id) + } + static func resourceName() -> String { "tournaments" } var id: String = Store.randomId() @@ -16,7 +25,10 @@ class Tournament : ModelObject, Storable { var club_id: String var category: Int var playerCount: Int - + + @ObservationIgnored + var navigationPath: [Screen] = [] + init(name: String, club_id: String, category: Int, playerCount: Int) { self.name = name self.club_id = club_id diff --git a/PadelClub/Launch Screen.storyboard b/PadelClub/Launch Screen.storyboard new file mode 100644 index 0000000..75ac2fe --- /dev/null +++ b/PadelClub/Launch Screen.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PadelClub/Model/NavigationDestination.swift b/PadelClub/Model/NavigationDestination.swift new file mode 100644 index 0000000..0e756b9 --- /dev/null +++ b/PadelClub/Model/NavigationDestination.swift @@ -0,0 +1,55 @@ +// +// NavigationDestination.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import Foundation + +enum NavigationDestination: CaseIterable, Identifiable { + var id: Self { + self + } + + case activity + case eventList + case toolbox + case tournamentOrganizer + case umpire + case padelClub + + var title: String { + switch self { + case .activity: + return "Activité" + case .eventList: + return "Journal" + case .toolbox: + return "Outils" + case .tournamentOrganizer: + return "Gestionnaire" + case .umpire: + return "Juge-Arbitre" + case .padelClub: + return "Padel Club" + } + } + + var image: String { + switch self { + case .activity: + return "calendar" + case .eventList: + return "book.closed" + case .toolbox: + return "wrench.and.screwdriver" + case .tournamentOrganizer: + return "squares.below.rectangle" + case .umpire: + return "person.bust" + case .padelClub: + return "shield" + } + } +} diff --git a/PadelClub/PadelClubApp.swift b/PadelClub/PadelClubApp.swift index fd2d028..89eaa2e 100644 --- a/PadelClub/PadelClubApp.swift +++ b/PadelClub/PadelClubApp.swift @@ -12,7 +12,7 @@ import LeStorage struct PadelClubApp: App { var body: some Scene { WindowGroup { - ContentView() + MainView() .onAppear { self._onAppear() } @@ -22,6 +22,7 @@ struct PadelClubApp: App { fileprivate func _onAppear() { let docURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] Logger.log("doc dir = \(docURL.absoluteString)") + UserDefaults.standard.set(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable") } } diff --git a/PadelClub/Views/Navigation/Agenda/ActivityView.swift b/PadelClub/Views/Navigation/Agenda/ActivityView.swift new file mode 100644 index 0000000..fd10f8e --- /dev/null +++ b/PadelClub/Views/Navigation/Agenda/ActivityView.swift @@ -0,0 +1,118 @@ +// +// ActivityView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct ActivityView: View { + @State private var searchText: String = "" + @State private var agendaDestination: AgendaDestination = .activity + + @State private var filterEnabled: Bool = false + @State private var presentToolbar: Bool = false + + var tournaments: [Tournament] { + switch agendaDestination { + case .activity: + [] + case .history: + DataStore.fakeTournaments + } + } + + func _activityStatus() -> String { + if tournaments.isEmpty && filterEnabled == false { + "Aucune activité" + } else { + "\(tournaments.count) tournois" + } + } + + var body: some View { + NavigationStack { + List { + Section { + AgendaDestinationPickerView(agendaDestination: $agendaDestination) + } + + if tournaments.isEmpty { + if searchText.isEmpty == false { + ContentUnavailableView.search(text: searchText) + } else if filterEnabled { + ContentUnavailableView { + Text("Aucun résultat") + } description: { + Text("Description du filtre") + } actions: { + RowButtonView(title: "supprimer le filtre") { + filterEnabled.toggle() + } + } + } else { + ContentUnavailableView { + Label("Aucune activité", systemImage: "shield.slash") + } description: { + Text("Aucun événement n'est prévu dans votre agenda.") + } actions: { + RowButtonView(title: "Créer un nouvel évenement") { + let tournament = Tournament(name: "P100", club_id: "", category: 0, playerCount: 24) + try? DataStore.shared.tournaments.append(contentOfs: [tournament]) + + } + RowButtonView(title: "Importer vos tournois Tenup") { + + } + } + } + } else { + EventListView(tournaments: tournaments) + } + } + .searchable(text: $searchText) + .onAppear { presentToolbar = true } + .onDisappear { presentToolbar = false } + .toolbar { + if presentToolbar { + ToolbarItem(placement: .status) { + VStack { + if filterEnabled { + Text("filtre actif") + .font(.footnote) + } + + Text(_activityStatus()) + .foregroundStyle(.secondary) + .font(.footnote) + } + } + + + ToolbarItemGroup(placement: .bottomBar) { + Button { + filterEnabled.toggle() + } label: { + Label("Vues", systemImage: "line.3.horizontal.decrease.circle") + .symbolVariant(filterEnabled ? .fill : .none) + } + Button { + + } label: { + Label("Ajouter", systemImage: "plus") + } + } + } + } + .navigationTitle(NavigationDestination.activity.title) + .navigationDestination(for: Tournament.self) { tournament in + TournamentView(tournament: tournament) + } + } + } +} + +#Preview { + ActivityView() +} diff --git a/PadelClub/Views/Navigation/Agenda/AgendaDestination.swift b/PadelClub/Views/Navigation/Agenda/AgendaDestination.swift new file mode 100644 index 0000000..787db2b --- /dev/null +++ b/PadelClub/Views/Navigation/Agenda/AgendaDestination.swift @@ -0,0 +1,33 @@ +// +// AgendaDestination.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import Foundation + +enum AgendaDestination: CaseIterable, Identifiable { + var id: Self { self } + + case activity + case history + + var localizedTitleKey: String { + switch self { + case .activity: + return "En cours" + case .history: + return "Terminé" + } + } + + var systemImage: String { + switch self { + case .activity: + return "squares.leading.rectangle" + case .history: + return "book.closed" + } + } +} diff --git a/PadelClub/Views/Navigation/Agenda/AgendaDestinationPickerView.swift b/PadelClub/Views/Navigation/Agenda/AgendaDestinationPickerView.swift new file mode 100644 index 0000000..f32670b --- /dev/null +++ b/PadelClub/Views/Navigation/Agenda/AgendaDestinationPickerView.swift @@ -0,0 +1,39 @@ +// +// AgendaDestinationPickerView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import SwiftUI + +struct AgendaDestinationPickerView: View { + @Binding var agendaDestination: AgendaDestination + + var body: some View { + HStack { + ForEach(AgendaDestination.allCases) { screen in + + Button { + agendaDestination = screen + } label: { + Label(screen.localizedTitleKey, systemImage: screen.systemImage) + } + .padding() + .background { + Capsule(style: .continuous) + .fill(.white) + .opacity(screen == agendaDestination ? 1.0 : 0.5) + } + .labelStyle(.titleOnly) + .buttonStyle(.plain) + } + } + .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) + .listRowBackground(Color.clear) + } +} + +#Preview { + AgendaDestinationPickerView(agendaDestination: .constant(.activity)) +} diff --git a/PadelClub/Views/Navigation/Agenda/EmptyActivityView.swift b/PadelClub/Views/Navigation/Agenda/EmptyActivityView.swift new file mode 100644 index 0000000..bfdaa40 --- /dev/null +++ b/PadelClub/Views/Navigation/Agenda/EmptyActivityView.swift @@ -0,0 +1,72 @@ +// +// EmptyActivityView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import SwiftUI +struct RowButtonView: View { + let title: String + var systemImage: String? = nil + var image: String? = nil + let action: () -> () + + var body: some View { + Button { + action() + } label: { + HStack { + Spacer() + if let systemImage { + Image(systemName: systemImage) + } + if let image { + Image(image) + .resizable() + .scaledToFit() + .frame(width: 32, height: 32) + } + Text(title) + .foregroundColor(.white) + .frame(height: 32) + Spacer() + } + .font(.headline) + } + .frame(maxWidth: .infinity) + .buttonStyle(.borderedProminent) + .tint(.launchScreenBackground) + .listRowBackground(Color.clear) + .listRowInsets(EdgeInsets(.zero)) + } +} + + + +struct EmptyActivityView: View { + var body: some View { + NavigationStack { + List { + WelcomeView() + + Section { + RowButtonView(title: "Créer votre premier événement", action: { + let tournament = Tournament(name: "P100", club_id: "", category: 0, playerCount: 24) + try? DataStore.shared.tournaments.append(contentOfs: [tournament]) + }) + } + + Section { + RowButtonView(title: "Importer vos tournois Tenup", action: { + + }) + } + } + } + } +} + +#Preview { + EmptyActivityView() +} diff --git a/PadelClub/Views/Navigation/Agenda/EventListView.swift b/PadelClub/Views/Navigation/Agenda/EventListView.swift new file mode 100644 index 0000000..fc60328 --- /dev/null +++ b/PadelClub/Views/Navigation/Agenda/EventListView.swift @@ -0,0 +1,77 @@ +// +// EventListView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct EventListView: View { + + let tournaments: [Tournament] + + var body: some View { + Section { + ForEach(tournaments) { tournament in + + NavigationLink(value: tournament) { + TournamentCellView(tournament: tournament) + } + .contextMenu { + Button { + + } label: { + Label("Voir dans le gestionnaire", systemImage: "line.diagonal.arrow") + } + } + } + .onDelete(perform: { indexSet in + for index in indexSet { + try? DataStore.shared.tournaments.delete(instance: tournaments[index]) + } + }) + } header: { + Text(Date().formatted(.dateTime.month().year())) + }.headerProminence(.increased) + } +} + +#Preview { + EventListView(tournaments: []) +} + +/* + .overlay(alignment: .bottom) { + Button { + } label: { + Circle() + .fill(Color.white) + .frame(width: 64) + .overlay( + Image(systemName: "plus") + .font(.title2) + .padding() + ) + .shadow(radius: /*@START_MENU_TOKEN@*/10/*@END_MENU_TOKEN@*/) + } + .buttonStyle(.plain) + .padding() + } + + Button { + } label: { + RoundedRectangle(cornerRadius: 20, style: .continuous) + .fill(Color.white) + .frame(height: 64) + .overlay( + Text("Créer un nouvel évenement") + .font(.title2) + .padding() + ) + .shadow(radius: 10) + } + .buttonStyle(.plain) + .padding() + + */ diff --git a/PadelClub/Views/Navigation/MainView.swift b/PadelClub/Views/Navigation/MainView.swift new file mode 100644 index 0000000..4d986e5 --- /dev/null +++ b/PadelClub/Views/Navigation/MainView.swift @@ -0,0 +1,55 @@ +// +// MainView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct MainView: View { + @StateObject var dataStore = DataStore.shared + + var body: some View { + TabView { + if dataStore.tournaments.isEmpty { + EmptyActivityView() + .tabItem(for: .activity) + } else { + ActivityView() + .tabItem(for: .activity) + } + TournamentOrganizerView() + .tabItem(for: .tournamentOrganizer) + ToolboxView() + .tabItem(for: .toolbox) + UmpireView() + .tabItem(for: .umpire) + PadelClubView() + .tabItem(for: .padelClub) + } + .environmentObject(dataStore) + } + +} + +fileprivate extension View { + func tabItem(for navigationDestination: NavigationDestination) -> some View { + modifier(TabItemModifier(navigationDestination: navigationDestination)) + } +} + +fileprivate struct TabItemModifier: ViewModifier { + let navigationDestination: NavigationDestination + + func body(content: Content) -> some View { + content + .tabItem { + Label(navigationDestination.title, systemImage: navigationDestination.image) + } + } +} + +#Preview { + MainView() +} diff --git a/PadelClub/Views/Navigation/Organizer/OrganizedTournamentView.swift b/PadelClub/Views/Navigation/Organizer/OrganizedTournamentView.swift new file mode 100644 index 0000000..76bcb2f --- /dev/null +++ b/PadelClub/Views/Navigation/Organizer/OrganizedTournamentView.swift @@ -0,0 +1,27 @@ +// +// OrganizedTournamentView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct OrganizedTournamentView: View { + let tournament: Tournament + @State private var navigationPath: [Screen] = [] + + init(tournament: Tournament) { + self.tournament = tournament + _navigationPath = State(wrappedValue: tournament.navigationPath) + } + + var body: some View { + NavigationStack(path: $navigationPath) { + TournamentView(tournament: tournament, presentationContext: .organizer) + .onChange(of: navigationPath) { + tournament.navigationPath = navigationPath + } + } + } +} diff --git a/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift b/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift new file mode 100644 index 0000000..35aba4e --- /dev/null +++ b/PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift @@ -0,0 +1,83 @@ +// +// TournamentOrganizerView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct TournamentOrganizerView: View { + @State private var selectedTournamentId: String? + + var body: some View { + VStack(spacing: 0) { + ForEach(DataStore.fakeTournaments) { tournament in + if tournament.id == selectedTournamentId { + OrganizedTournamentView(tournament: tournament) + } + } + + if selectedTournamentId == nil { + NavigationStack { + ContentUnavailableView("Aucun tournoi sélectionné", systemImage: "rectangle.slash", description: Text("Utilisez l'accès rapide ci-dessous pour éditer un tournoi et passer rapidement d'un tournoi à l'autre.")) + .navigationTitle("Gestionnaire de tournois") + .navigationBarTitleDisplayMode(.inline) + } + } + Divider() + HStack { + ScrollView(.horizontal) { + HStack { + ForEach(DataStore.fakeTournaments) { tournament in + TournamentButtonView(tournament: tournament, selectedId: $selectedTournamentId) + } + } + .padding() + .buttonStyle(.plain) + } + } + } + } + + struct TournamentButtonView: View { + let tournament: Tournament + @Binding var selectedId: String? + + var body: some View { + Button { + if selectedId == tournament.id { + tournament.navigationPath.removeAll() + selectedId = nil +// if tournament.navigationPath.isEmpty { +// selectedId = nil +// } else { +// tournament.navigationPath.removeLast() +// } + } else { + selectedId = tournament.id + } + } label: { + TournamentCellView(tournament: tournament) + .padding(8) + .overlay( + RoundedRectangle(cornerRadius: 20) + .stroke(Color.black, lineWidth: 2) + ) + .fixedSize(horizontal: false, vertical: true) + } + .overlay(alignment: .top) { + if selectedId == tournament.id { + Image(systemName: "ellipsis") + .offset(y: -10) + } + } + + } + } + +} + +#Preview { + TournamentOrganizerView() +} diff --git a/PadelClub/Views/Navigation/PadelClubView.swift b/PadelClub/Views/Navigation/PadelClubView.swift new file mode 100644 index 0000000..75d7c68 --- /dev/null +++ b/PadelClub/Views/Navigation/PadelClubView.swift @@ -0,0 +1,21 @@ +// +// PadelClubView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import SwiftUI + +struct PadelClubView: View { + var body: some View { + NavigationStack { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + .navigationTitle(NavigationDestination.padelClub.title) + } + } +} + +#Preview { + PadelClubView() +} diff --git a/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift b/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift new file mode 100644 index 0000000..1a08e01 --- /dev/null +++ b/PadelClub/Views/Navigation/Toolbox/ToolboxView.swift @@ -0,0 +1,21 @@ +// +// ToolboxView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct ToolboxView: View { + var body: some View { + NavigationStack { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + .navigationTitle(NavigationDestination.toolbox.title) + } + } +} + +#Preview { + ToolboxView() +} diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift new file mode 100644 index 0000000..e124d21 --- /dev/null +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -0,0 +1,33 @@ +// +// UmpireView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import SwiftUI + +struct UmpireView: View { + + var body: some View { + NavigationStack { + List { + NavigationLink { + MainUserView() + } label: { + Label("Mon compte", systemImage: "person.circle.fill") + } + NavigationLink { + SubscriptionView() + } label: { + Label("Abonnement", systemImage: "tennisball.circle.fill") + } + + } + } + } +} + +#Preview { + UmpireView() +} diff --git a/PadelClub/Views/Navigation/WelcomeView.swift b/PadelClub/Views/Navigation/WelcomeView.swift new file mode 100644 index 0000000..b0eeab4 --- /dev/null +++ b/PadelClub/Views/Navigation/WelcomeView.swift @@ -0,0 +1,24 @@ +// +// WelcomeView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 01/03/2024. +// + +import SwiftUI + +struct WelcomeView: View { + var body: some View { + Image(.padelClubLogoFondfonce) + .resizable() + .scaledToFit() + .buttonStyle(.borderedProminent) + .tint(.launchScreenBackground) + .listRowBackground(Color.clear) + .listRowInsets(EdgeInsets(.zero)) + } +} + +#Preview { + WelcomeView() +} diff --git a/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift new file mode 100644 index 0000000..2dd5a8b --- /dev/null +++ b/PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift @@ -0,0 +1,19 @@ +// +// InscriptionManagerView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct InscriptionManagerView: View { + let tournament: Tournament + + var body: some View { + List { + Text(tournament.playerCount.formatted()) + } + .navigationTitle("Inscriptions") + } +} diff --git a/PadelClub/Views/Tournament/Shared/DateBoxView.swift b/PadelClub/Views/Tournament/Shared/DateBoxView.swift new file mode 100644 index 0000000..a9430a4 --- /dev/null +++ b/PadelClub/Views/Tournament/Shared/DateBoxView.swift @@ -0,0 +1,30 @@ +// +// DateBoxView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct DateBoxView: View { + let date: Date + + var body: some View { + VStack(alignment: .center, spacing: -2) { + Text(date.formatted(.dateTime.weekday(.abbreviated))) + .font(.caption2) + Text(date.formatted(.dateTime.day())) + .font(.title) + Text(date.formatted(.dateTime.month(.abbreviated))) + .font(.caption2) + Text(date.formatted(.dateTime.year())) + .font(.caption2) + + } + } +} + +#Preview { + DateBoxView(date: Date()) +} diff --git a/PadelClub/Views/Tournament/Shared/TournamentCellView.swift b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift new file mode 100644 index 0000000..2a1145e --- /dev/null +++ b/PadelClub/Views/Tournament/Shared/TournamentCellView.swift @@ -0,0 +1,31 @@ +// +// TournamentCellView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +struct TournamentCellView: View { + + let tournament: Tournament + let color: Color = .black + + var body: some View { + HStack(alignment: .top) { + DateBoxView(date: Date()) + Rectangle() + .fill(color) + .frame(width: 2) + VStack(alignment: .leading, spacing: -2) { + Text("Homme") + .font(.caption2) + Text(tournament.name) + .font(.title) + Text("Senior") + .font(.caption2) + } + } + } +} diff --git a/PadelClub/Views/Tournament/TournamentView.swift b/PadelClub/Views/Tournament/TournamentView.swift new file mode 100644 index 0000000..cc287af --- /dev/null +++ b/PadelClub/Views/Tournament/TournamentView.swift @@ -0,0 +1,72 @@ +// +// TournamentView.swift +// PadelClub +// +// Created by Razmig Sarkissian on 29/02/2024. +// + +import SwiftUI + +enum Screen: String, Codable { + case inscription + case groupStage +} + +enum PresentationContext { + case agenda + case organizer +} + +struct TournamentView: View { + @State var tournament: Tournament + var presentationContext: PresentationContext = .agenda + + var body: some View { + List { + InscriptionManagerRowView(tournament: tournament) + NavigationLink(value: Screen.groupStage) { + Text("Poules") + .badge(2) + } + } + .navigationDestination(for: Screen.self, destination: { screen in + switch screen { + case .inscription: + InscriptionManagerView(tournament: tournament) + case .groupStage: + Text("Poules \(screen.rawValue)") + } + }) + .navigationTitle(tournament.name) + .toolbar { + if presentationContext == .agenda { + ToolbarItem(placement: .topBarTrailing) { + Menu { + Button { + + } label: { + Label("Voir dans le gestionnaire", systemImage: "line.diagonal.arrow") + } + } label: { + Label("Options", systemImage: "ellipsis.circle") + } + } + } + } + + } + + struct InscriptionManagerRowView: View { + let tournament: Tournament + var body: some View { + NavigationLink(value: Screen.inscription) { + Text("Inscriptions") + .badge(tournament.playerCount) + } + } + } +} +// +//#Preview { +// TournamentView(tournament: Tournament(name: "", club_id: "", category: 0, playerCount: 0)) +//}