Bug fixes and UI polish

This commit is contained in:
VincentMeilinger
2024-03-07 19:09:39 +01:00
parent 92decb773e
commit dbe626d595
15 changed files with 922 additions and 175 deletions

View File

@@ -18,37 +18,47 @@ struct ShareView: View {
@State var sharedURL: URL? = nil
var body: some View {
VStack(alignment: .leading) {
if let url = sharedURL {
ShareLink(item: url, subject: Text("PDF Document")) {
Image(systemName: "doc")
Text("Share as PDF")
NavigationStack {
VStack(alignment: .leading) {
if let url = sharedURL {
ShareLink(item: url, subject: Text("PDF Document")) {
Image(systemName: "doc")
Text("Share as PDF")
}
.foregroundStyle(.primary)
.bold()
.padding()
}
ShareLink(item: exporter.createText(recipe: recipeDetail), subject: Text("Recipe")) {
Image(systemName: "ellipsis.message")
Text("Share as text")
}
.foregroundStyle(.primary)
.bold()
.padding()
/*ShareLink(item: exporter.createJson(recipe: recipeDetail), subject: Text("Recipe")) {
Image(systemName: "doc.badge.gearshape")
Text("Share as JSON")
}
.foregroundStyle(.primary)
.bold()
.padding()
*/
}
ShareLink(item: exporter.createText(recipe: recipeDetail), subject: Text("Recipe")) {
Image(systemName: "ellipsis.message")
Text("Share as text")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Done") {
presentShareSheet = false
}
}
}
.foregroundStyle(.primary)
.bold()
.padding()
/*ShareLink(item: exporter.createJson(recipe: recipeDetail), subject: Text("Recipe")) {
Image(systemName: "doc.badge.gearshape")
Text("Share as JSON")
}
.foregroundStyle(.primary)
.bold()
.padding()
*/
}
.task {
self.sharedURL = exporter.createPDF(recipe: recipeDetail, image: recipeImage)
}
}
}