Added category 'All' recipes

This commit is contained in:
Vicnet
2023-10-22 20:28:51 +02:00
parent 05c30a2cff
commit 8f32946e27
17 changed files with 574 additions and 243 deletions

View File

@@ -16,11 +16,24 @@ struct RecipeCardView: View {
var body: some View {
HStack {
Image(uiImage: recipeThumb ?? UIImage(named: "cookbook-recipe")!)
.resizable()
.aspectRatio(contentMode: .fill)
if let recipeThumb = recipeThumb {
Image(uiImage: recipeThumb)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 80, height: 80)
.clipped()
} else {
ZStack {
Image(systemName: "square.text.square")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundStyle(Color.white)
.padding(10)
}
.background(Color("ncblue"))
.frame(width: 80, height: 80)
.clipped()
}
Text(recipe.name)
.font(.headline)