diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 5f5df08..1fab51f 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -86,7 +86,6 @@ FF1CBC1F2BB53E0C0036DAAB /* FederalTournamentSearchScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1CBC1E2BB53E0C0036DAAB /* FederalTournamentSearchScope.swift */; }; FF1CBC222BB53E590036DAAB /* FederalTournamentHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1CBC212BB53E590036DAAB /* FederalTournamentHolder.swift */; }; FF1CBC232BB53E590036DAAB /* ClubHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1CBC202BB53E590036DAAB /* ClubHolder.swift */; }; - FF1CBC252BB54C9F0036DAAB /* TenupEventListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1CBC242BB54C9F0036DAAB /* TenupEventListView.swift */; }; FF1DC5512BAB351300FD8220 /* ClubDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1DC5502BAB351300FD8220 /* ClubDetailView.swift */; }; FF1DC5532BAB354A00FD8220 /* MockData.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1DC5522BAB354A00FD8220 /* MockData.swift */; }; FF1DC5552BAB36DD00FD8220 /* CreateClubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1DC5542BAB36DD00FD8220 /* CreateClubView.swift */; }; @@ -317,7 +316,6 @@ FF1CBC1E2BB53E0C0036DAAB /* FederalTournamentSearchScope.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FederalTournamentSearchScope.swift; sourceTree = ""; }; FF1CBC202BB53E590036DAAB /* ClubHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClubHolder.swift; sourceTree = ""; }; FF1CBC212BB53E590036DAAB /* FederalTournamentHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FederalTournamentHolder.swift; sourceTree = ""; }; - FF1CBC242BB54C9F0036DAAB /* TenupEventListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TenupEventListView.swift; sourceTree = ""; }; FF1DC5502BAB351300FD8220 /* ClubDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClubDetailView.swift; sourceTree = ""; }; FF1DC5522BAB354A00FD8220 /* MockData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockData.swift; sourceTree = ""; }; FF1DC5542BAB36DD00FD8220 /* CreateClubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateClubView.swift; sourceTree = ""; }; @@ -898,7 +896,6 @@ FFD784032B91C280000F62A6 /* EmptyActivityView.swift */, FFD784012B91C1B4000F62A6 /* WelcomeView.swift */, FF59FFB22B90EFAC0061EFF9 /* EventListView.swift */, - FF1CBC242BB54C9F0036DAAB /* TenupEventListView.swift */, FF5D0D8A2BB4D1E3005CB568 /* CalendarView.swift */, FFD783FC2B91B9ED000F62A6 /* AgendaDestinationPickerView.swift */, ); @@ -1216,7 +1213,6 @@ FFF8ACD92B923F3C008466FA /* String+Extensions.swift in Sources */, FFA6D7852BB0B795003A31F3 /* FileImportManager.swift in Sources */, FF6EC8FB2B94788600EA7F5A /* TournamentButtonView.swift in Sources */, - FF1CBC252BB54C9F0036DAAB /* TenupEventListView.swift in Sources */, FFF8ACCD2B92367B008466FA /* FederalPlayer.swift in Sources */, FF6EC9092B947A5300EA7F5A /* FixedWidthInteger+Extensions.swift in Sources */, FFC1E1042BAC28C6008D6F59 /* ClubSearchView.swift in Sources */, diff --git a/PadelClub/Views/Navigation/Agenda/TenupEventListView.swift b/PadelClub/Views/Navigation/Agenda/TenupEventListView.swift deleted file mode 100644 index 8bb8756..0000000 --- a/PadelClub/Views/Navigation/Agenda/TenupEventListView.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// TenupEventListView.swift -// PadelClub -// -// Created by Razmig Sarkissian on 28/03/2024. -// - -import SwiftUI - -struct TenupEventListView: View { - @EnvironmentObject var dataStore: DataStore - - let tournaments: [FederalTournament] - let viewStyle: AgendaDestination.ViewStyle - - var body: some View { - let groupedTournamentsByDate = Dictionary(grouping: tournaments) { $0.startDate.startOfMonth } - - ForEach(groupedTournamentsByDate.keys.sorted(by: <), id: \.self) { section in - if let _tournaments = groupedTournamentsByDate[section]?.sorted(by: \.startDate) { - Section { - switch viewStyle { - case .list: - _listView(_tournaments) - case .calendar: - CalendarView(date: section, tournaments: _tournaments) - } - } header: { - HStack { - Text(section.monthYearFormatted) - Spacer() - Text(_tournaments.map { $0.tournaments.count }.reduce(0,+).formatted()) - } - } - .headerProminence(.increased) - } - } - } - - private func _listView(_ tournaments: [FederalTournament]) -> some View { - ForEach(tournaments, id: \.holderId) { tournament in - TournamentCellView(tournament: tournament) - } - } - - /* - Button("importer") { - let event = dataStore.events.first(where: { $0.tenupId == tournament.id.string }) ?? Event(tenupId: tournament.id.string) - let tournament = Tournament(event: event.id, ) - } - .buttonStyle(.bordered) - .buttonBorderShape(.capsule) - - */ -} - -#Preview { - TenupEventListView(tournaments: [], viewStyle: .calendar) -}