31 lines
758 B
Swift
31 lines
758 B
Swift
//
|
|
// CircleView.swift
|
|
// Feels (iOS)
|
|
//
|
|
// Created by Trey Tartt on 1/13/22.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct DayChartView: ChartViewItemBuildable, View, Hashable {
|
|
init(color: Color, weekDay: Int, shape: BGShape) {
|
|
self.color = color
|
|
self.weekDay = weekDay
|
|
self.shape = shape
|
|
}
|
|
|
|
var id = UUID()
|
|
var color: Color
|
|
var weekDay: Int
|
|
var shape: BGShape
|
|
|
|
var body: some View {
|
|
shape.view(withText: Text(""), bgColor: color, textColor: .clear)
|
|
.frame(minWidth: 5, idealWidth: 50, maxWidth: 50,
|
|
minHeight: 5, idealHeight: 20, maxHeight: 50,
|
|
alignment: .center)
|
|
.opacity(color == Mood.missing.color ? 0.5 : 1.0)
|
|
}
|
|
}
|