fitness_app/FitnessApp/Home/Views/ActivityCard.swift
Matt Bruce 1df20c79cb reaaaranged
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
2024-12-20 14:17:51 -06:00

47 lines
1.2 KiB
Swift

//
// ActivityCard.swift
// FitnessApp
//
// Created by Matt Bruce on 12/20/24.
//
import SwiftUI
struct ActivityCard: View {
@State var activity: Activity
var body: some View {
ZStack {
Color(uiColor: .systemGray6).cornerRadius(15)
VStack {
HStack(alignment: .top) {
VStack(alignment: .leading, spacing: 8) {
Text(activity.title)
Text(activity.subtitle).font(.caption)
}
Spacer()
Image(systemName: activity.image)
.foregroundColor(activity.tintColor)
}
Text(activity.amount)
.font(.title)
.bold()
.padding()
}
.padding()
}
}
}
#Preview {
ActivityCard(activity: .init(id: 1,
title: "Test",
subtitle: "Goal 10,000",
image: "walk",
tintColor: .green,
amount: "9,000"))
}