From c4a6d37446cd40274b24e4b16c51ccc39f2b2fa1 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Mon, 6 May 2024 21:40:30 +0200 Subject: [PATCH] fix file import view --- .../Views/Tournament/FileImportView.swift | 36 +++++++++---------- .../Tournament/TournamentRunningView.swift | 4 +-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/PadelClub/Views/Tournament/FileImportView.swift b/PadelClub/Views/Tournament/FileImportView.swift index 309cd98..d269e23 100644 --- a/PadelClub/Views/Tournament/FileImportView.swift +++ b/PadelClub/Views/Tournament/FileImportView.swift @@ -36,29 +36,27 @@ struct FileImportView: View { List { if teams.isEmpty { Section { - - Link(destination: URLs.beachPadel.url) { - Label("beach-padel.app.fft.fr", systemImage: "tennisball") - } - - Picker(selection: $fileProvider) { - ForEach(FileImportManager.FileProvider.allCases) { - Text($0.localizedLabel).tag($0) - } - } label: { - Text("Source du fichier") - } - - Button { + RowButtonView("Choisir le fichier", systemImage: "square.and.arrow.down") { convertingFile = false isShowing.toggle() - } label: { - Label("Choisir le fichier", systemImage: "square.and.arrow.down") } - } header: { - } footer: { - Text("Fichier provenant de beach-padel.app.fft.fr") + if fileProvider == .frenchFederation { + let footerString = "Fichier provenant de [beach-padel.app.fft.fr](\(URLs.beachPadel.rawValue))" + Text(.init(footerString)) + } + } + + if fileContent != nil { + Section { + Picker(selection: $fileProvider) { + ForEach(FileImportManager.FileProvider.allCases) { + Text($0.localizedLabel).tag($0) + } + } label: { + Text("Source du fichier") + } + } } } diff --git a/PadelClub/Views/Tournament/TournamentRunningView.swift b/PadelClub/Views/Tournament/TournamentRunningView.swift index 95e360f..3b13623 100644 --- a/PadelClub/Views/Tournament/TournamentRunningView.swift +++ b/PadelClub/Views/Tournament/TournamentRunningView.swift @@ -73,8 +73,8 @@ struct TournamentRunningView: View { } MatchListView(section: "en cours", matches: tournament.runningMatches(allMatches)) -// MatchListView(section: "à lancer", matches: tournament.readyMatches(allMatches)) -// MatchListView(section: "disponible", matches: tournament.availableToStart(allMatches)) + MatchListView(section: "à lancer", matches: tournament.readyMatches(allMatches), isExpanded: false) + MatchListView(section: "disponible", matches: tournament.availableToStart(allMatches), isExpanded: false) MatchListView(section: "terminés", matches: tournament.finishedMatches(allMatches), isExpanded: false) } }