|
|
|
@ -7,6 +7,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
import SwiftUI |
|
|
|
import SwiftUI |
|
|
|
import LeStorage |
|
|
|
import LeStorage |
|
|
|
|
|
|
|
import Zip |
|
|
|
|
|
|
|
|
|
|
|
struct ToolboxView: View { |
|
|
|
struct ToolboxView: View { |
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
@EnvironmentObject var dataStore: DataStore |
|
|
|
@ -210,14 +211,38 @@ struct ToolboxView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
.navigationTitle(TabDestination.toolbox.title) |
|
|
|
.navigationTitle(TabDestination.toolbox.title) |
|
|
|
.toolbar { |
|
|
|
.toolbar { |
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
ToolbarItem(placement: .topBarLeading) { |
|
|
|
Link(destination: URLs.appStore.url) { |
|
|
|
Link(destination: URLs.appStore.url) { |
|
|
|
Text("v\(PadelClubApp.appVersion)") |
|
|
|
Text("v\(PadelClubApp.appVersion)") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ToolbarItem(placement: .topBarTrailing) { |
|
|
|
|
|
|
|
Menu { |
|
|
|
|
|
|
|
ShareLink(item: URLs.appStore.url) { |
|
|
|
|
|
|
|
Label("Lien AppStore", systemImage: "link") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if let zip = _getZip() { |
|
|
|
|
|
|
|
ShareLink(item: zip) { |
|
|
|
|
|
|
|
Label("Mes données", systemImage: "server.rack") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} label: { |
|
|
|
|
|
|
|
Label("Partagez", systemImage: "square.and.arrow.up").labelStyle(.iconOnly) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func _getZip() -> URL? { |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
let filePath = try Club.storageDirectoryPath() |
|
|
|
|
|
|
|
return try Zip.quickZipFiles([filePath], fileName: "backup") // Zip |
|
|
|
|
|
|
|
} catch { |
|
|
|
|
|
|
|
Logger.error(error) |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//#Preview { |
|
|
|
//#Preview { |
|
|
|
|