Download function for all recipes or recipes in a certain category

This commit is contained in:
Vicnet
2023-09-19 09:39:08 +02:00
parent 5fdfed9413
commit 4350cad1e0
6 changed files with 99 additions and 9 deletions

View File

@@ -12,6 +12,8 @@ struct RecipeCardView: View {
@State var viewModel: MainViewModel
@State var recipe: Recipe
@State var recipeThumb: UIImage?
@State var isDownloaded: Bool
var body: some View {
HStack {
Image(uiImage: recipeThumb ?? UIImage(named: "CookBook")!)
@@ -23,6 +25,12 @@ struct RecipeCardView: View {
.font(.headline)
Spacer()
VStack {
Image(systemName: isDownloaded ? "checkmark.icloud" : "icloud.and.arrow.down")
.foregroundColor(.secondary)
.padding()
Spacer()
}
}
.background(.ultraThickMaterial)
.clipShape(RoundedRectangle(cornerRadius: 10))