This commit is contained in:
Trey t
2025-12-09 23:36:57 -06:00
parent 316513e516
commit 3a10b4b8d6
1586 changed files with 0 additions and 7710 deletions

View File

@@ -0,0 +1,56 @@
//
// EntryListView.swift
// Feels (iOS)
//
// Created by Trey Tartt on 3/6/22.
//
import SwiftUI
struct EntryListView: View {
@AppStorage(UserDefaultsStore.Keys.moodImages.rawValue, store: GroupUserDefaults.groupDefaults) private var imagePack: MoodImages = .FontAwesome
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
public let entry: MoodEntry
var body: some View {
HStack {
imagePack.icon(forMood: entry.mood)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 40, height: 40, alignment: .center)
.foregroundColor(moodTint.color(forMood: entry.mood))
.padding(.leading, 15)
VStack {
HStack {
Text(Random.weekdayName(fromDate:entry.forDate!))
.font(.title3)
.foregroundColor(textColor)
Text(" - ")
.padding([.leading, .trailing], -10)
.foregroundColor(textColor)
Text(Random.dayFormat(fromDate:entry.forDate!))
.font(.title3)
.foregroundColor(textColor)
Spacer()
}
.multilineTextAlignment(.leading)
Text(entry.moodValue == Mood.missing.rawValue ? String(localized: "mood_value_missing_tap_to_add") : "\(entry.moodString)")
.font(.body)
.foregroundColor(Color(UIColor.systemGray))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
}
struct EntryListView_Previews: PreviewProvider {
static let fakeData = PersistenceController.shared.randomEntries(count: 1).first!
static var previews: some View {
EntryListView(entry: EntryListView_Previews.fakeData)
}
}