first update de raz

multistore
Razmig Sarkissian 2 years ago
parent 35a0056f86
commit 602ae91c40
  1. 148
      PadelClub.xcodeproj/project.pbxproj
  2. 1
      PadelClub/Assets.xcassets/AppIcon.appiconset/Contents.json
  3. BIN
      PadelClub/Assets.xcassets/AppIcon.appiconset/PadelClub_icone.png
  4. 353
      PadelClub/Assets.xcassets/LaunchScreenBackground.colorset/Contents.json
  5. 12
      PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/Contents.json
  6. BIN
      PadelClub/Assets.xcassets/PadelClub_logo_fondclair_transparent.imageset/PadelClub_logo_fondclair_transparent.png
  7. 12
      PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/Contents.json
  8. BIN
      PadelClub/Assets.xcassets/PadelClub_logo_fondfonce.imageset/PadelClub_logo_fondfonce.png
  9. 12
      PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/Contents.json
  10. BIN
      PadelClub/Assets.xcassets/PadelClub_logo_fondfonce_transparent.imageset/PadelClub_logo_fondfonce_transparent.png
  11. 12
      PadelClub/Assets.xcassets/logo.imageset/Contents.json
  12. BIN
      PadelClub/Assets.xcassets/logo.imageset/PadelClub_small.png
  13. 11
      PadelClub/Data/DataStore.swift
  14. 16
      PadelClub/Data/Tournament.swift
  15. 49
      PadelClub/Launch Screen.storyboard
  16. 55
      PadelClub/Model/NavigationDestination.swift
  17. 3
      PadelClub/PadelClubApp.swift
  18. 118
      PadelClub/Views/Navigation/Agenda/ActivityView.swift
  19. 33
      PadelClub/Views/Navigation/Agenda/AgendaDestination.swift
  20. 39
      PadelClub/Views/Navigation/Agenda/AgendaDestinationPickerView.swift
  21. 72
      PadelClub/Views/Navigation/Agenda/EmptyActivityView.swift
  22. 77
      PadelClub/Views/Navigation/Agenda/EventListView.swift
  23. 55
      PadelClub/Views/Navigation/MainView.swift
  24. 27
      PadelClub/Views/Navigation/Organizer/OrganizedTournamentView.swift
  25. 83
      PadelClub/Views/Navigation/Organizer/TournamentOrganizerView.swift
  26. 21
      PadelClub/Views/Navigation/PadelClubView.swift
  27. 21
      PadelClub/Views/Navigation/Toolbox/ToolboxView.swift
  28. 33
      PadelClub/Views/Navigation/Umpire/UmpireView.swift
  29. 24
      PadelClub/Views/Navigation/WelcomeView.swift
  30. 19
      PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift
  31. 30
      PadelClub/Views/Tournament/Shared/DateBoxView.swift
  32. 31
      PadelClub/Views/Tournament/Shared/TournamentCellView.swift
  33. 72
      PadelClub/Views/Tournament/TournamentView.swift

@ -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 = "<group>"; };
C4A47DB02B86375E00ADC637 /* MainUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainUserView.swift; sourceTree = "<group>"; };
C4A47DB22B86387500ADC637 /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
FF3F74F52B919E45004CFE0E /* UmpireView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UmpireView.swift; sourceTree = "<group>"; };
FF3F74FE2B91A2D4004CFE0E /* AgendaDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgendaDestination.swift; sourceTree = "<group>"; };
FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListView.swift; sourceTree = "<group>"; };
FF59FFB62B90EFBF0061EFF9 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
FF59FFB82B90EFD70061EFF9 /* ToolboxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolboxView.swift; sourceTree = "<group>"; };
FF7091612B90F04300AB08DA /* TournamentOrganizerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentOrganizerView.swift; sourceTree = "<group>"; };
FF7091652B90F0B000AB08DA /* NavigationDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationDestination.swift; sourceTree = "<group>"; };
FF7091672B90F79F00AB08DA /* TournamentCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentCellView.swift; sourceTree = "<group>"; };
FF7091692B90F95E00AB08DA /* DateBoxView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateBoxView.swift; sourceTree = "<group>"; };
FF70916B2B91005400AB08DA /* TournamentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TournamentView.swift; sourceTree = "<group>"; };
FF70916D2B9108C600AB08DA /* InscriptionManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InscriptionManagerView.swift; sourceTree = "<group>"; };
FF82CFC42B911F5B00B0CAF2 /* OrganizedTournamentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganizedTournamentView.swift; sourceTree = "<group>"; };
FF82CFC82B9132AF00B0CAF2 /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = "<group>"; };
FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgendaDestinationPickerView.swift; sourceTree = "<group>"; };
FFD783FE2B91BA42000F62A6 /* PadelClubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PadelClubView.swift; sourceTree = "<group>"; };
FFD784002B91BF79000F62A6 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
FFD784012B91C1B4000F62A6 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = "<group>"; };
FFD784032B91C280000F62A6 /* EmptyActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyActivityView.swift; sourceTree = "<group>"; };
/* 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 = "<group>";
@ -279,6 +318,92 @@
path = Components;
sourceTree = "<group>";
};
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 = "<group>";
};
FF3F74F72B919F96004CFE0E /* Tournament */ = {
isa = PBXGroup;
children = (
FF70916B2B91005400AB08DA /* TournamentView.swift */,
FF3F74F92B91A018004CFE0E /* Screen */,
FF3F74F82B919FB2004CFE0E /* Shared */,
);
path = Tournament;
sourceTree = "<group>";
};
FF3F74F82B919FB2004CFE0E /* Shared */ = {
isa = PBXGroup;
children = (
FF7091672B90F79F00AB08DA /* TournamentCellView.swift */,
FF7091692B90F95E00AB08DA /* DateBoxView.swift */,
);
path = Shared;
sourceTree = "<group>";
};
FF3F74F92B91A018004CFE0E /* Screen */ = {
isa = PBXGroup;
children = (
FF70916D2B9108C600AB08DA /* InscriptionManagerView.swift */,
);
path = Screen;
sourceTree = "<group>";
};
FF3F74FA2B91A04B004CFE0E /* Organizer */ = {
isa = PBXGroup;
children = (
FF7091612B90F04300AB08DA /* TournamentOrganizerView.swift */,
FF82CFC42B911F5B00B0CAF2 /* OrganizedTournamentView.swift */,
);
path = Organizer;
sourceTree = "<group>";
};
FF3F74FB2B91A060004CFE0E /* Toolbox */ = {
isa = PBXGroup;
children = (
FF59FFB82B90EFD70061EFF9 /* ToolboxView.swift */,
);
path = Toolbox;
sourceTree = "<group>";
};
FF3F74FC2B91A06B004CFE0E /* Umpire */ = {
isa = PBXGroup;
children = (
FF3F74F52B919E45004CFE0E /* UmpireView.swift */,
);
path = Umpire;
sourceTree = "<group>";
};
FF3F74FD2B91A087004CFE0E /* Model */ = {
isa = PBXGroup;
children = (
FF7091652B90F0B000AB08DA /* NavigationDestination.swift */,
);
path = Model;
sourceTree = "<group>";
};
FFD783FB2B91B919000F62A6 /* Agenda */ = {
isa = PBXGroup;
children = (
FF82CFC82B9132AF00B0CAF2 /* ActivityView.swift */,
FFD784032B91C280000F62A6 /* EmptyActivityView.swift */,
FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */,
FF3F74FE2B91A2D4004CFE0E /* AgendaDestination.swift */,
FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */,
);
path = Agenda;
sourceTree = "<group>";
};
/* 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 = (

@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "PadelClub_icone.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

@ -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
}
}

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "PadelClub_logo_fondclair_transparent.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "PadelClub_logo_fondfonce.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "PadelClub_logo_fondfonce_transparent.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "PadelClub_small.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -12,6 +12,8 @@ import SwiftUI
class DataStore: ObservableObject {
// fileprivate var _store: Store
static let shared = DataStore()
fileprivate(set) var tournaments: StoredCollection<Tournament>
fileprivate(set) var clubs: StoredCollection<Club>
@ -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
}

@ -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

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PadelClub_logo_fondfonce_transparent" translatesAutoresizingMaskIntoConstraints="NO" id="Lsd-2D-TDo">
<rect key="frame" x="64" y="-628.66666666666663" width="265" height="2134.3333333333335"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" name="LaunchScreenBackground"/>
<color key="tintColor" name="AccentColor"/>
<constraints>
<constraint firstItem="Lsd-2D-TDo" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="7Tm-4j-KPz"/>
<constraint firstItem="Lsd-2D-TDo" firstAttribute="width" secondItem="Ze5-6b-2t3" secondAttribute="height" multiplier="265:852" id="Nhb-n4-HGG"/>
<constraint firstItem="Lsd-2D-TDo" firstAttribute="centerY" secondItem="Bcu-3y-fUS" secondAttribute="centerY" id="xOG-dI-NIb"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.671755725190835" y="374.64788732394368"/>
</scene>
</scenes>
<color key="tintColor" name="LaunchScreenBackground"/>
<resources>
<image name="PadelClub_logo_fondfonce_transparent" width="1926" height="2134"/>
<namedColor name="AccentColor">
<color red="0.0" green="0.46000000000000002" blue="0.89000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="LaunchScreenBackground">
<color red="0.098039215686274508" green="0.13725490196078433" blue="0.22745098039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>

@ -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"
}
}
}

@ -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")
}
}

@ -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()
}

@ -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"
}
}
}

@ -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))
}

@ -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()
}

@ -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()
*/

@ -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()
}

@ -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
}
}
}
}

@ -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()
}

@ -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()
}

@ -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()
}

@ -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()
}

@ -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()
}

@ -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")
}
}

@ -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())
}

@ -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)
}
}
}
}

@ -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))
//}
Loading…
Cancel
Save