TempTrack-iOS/TempTrack/Views/HistoryList.swift
2023-06-08 09:52:20 +02:00

29 lines
780 B
Swift

import SwiftUI
struct HistoryList: View {
@EnvironmentObject
var storage: TemperatureStorage
var body: some View {
NavigationView {
List(storage.dailyMeasurementCounts) { day in
NavigationLink(destination: {
TemperatureDayOverview(storage: storage, dateIndex: day.dateIndex)
}) {
HistoryListRow(entry: day)
}
}
.navigationTitle("History")
.navigationBarTitleDisplayMode(.large)
}
}
}
struct HistoryList_Previews: PreviewProvider {
static var previews: some View {
HistoryList()
.environmentObject(TemperatureStorage(lastMeasurements: TemperatureMeasurement.mockData))
}
}