46 lines
1.2 KiB
Swift
46 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(title: "Test",
|
|
subtitle: "Goal 10,000",
|
|
image: "walk",
|
|
tintColor: .green,
|
|
amount: "9,000"))
|
|
}
|