Files
Nextcloud-Cookbook-iOS/Nextcloud Cookbook iOS Client/Views/CategoryCardView.swift
2023-09-30 10:07:27 +02:00

37 lines
997 B
Swift

//
// CategoryCardView.swift
// Nextcloud Cookbook iOS Client
//
// Created by Vincent Meilinger on 15.09.23.
//
import Foundation
import SwiftUI
struct CategoryCardView: View {
@State var category: Category
var body: some View {
ZStack {
Image("CookBook")
.aspectRatio(1, contentMode: .fit)
.overlay(
VStack {
Spacer()
Color.clear
.background(
.ultraThickMaterial
)
.overlay(
Text(category.name == "*" ? "Other" : category.name)
.font(.headline)
)
.frame(maxHeight: 25)
}
)
.clipShape(RoundedRectangle(cornerRadius: 10))
.padding()
}
}
}