TempTrack-iOS/TempTrack/Views/HistoryList.swift

29 lines
780 B
Swift
Raw Normal View History

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))
}
}