Refactored image in TrashEvent

This commit is contained in:
2024-01-13 00:07:14 +01:00
parent f153b26d2d
commit 01381f9f25
8 changed files with 154 additions and 77 deletions

32
TrashTrack/MainView.swift Normal file
View File

@@ -0,0 +1,32 @@
//
// ContentView.swift
// TrashTrack
//
// Created by Oliver Hnát on 12.01.2024.
//
import SwiftUI
struct MainView: View {
var model = TrashModelView()
var body: some View {
VStack {
ForEach(model.getTrashEvents()) { trashEvent in
HStack {
Image(systemName: trashEvent.trash.image)
.imageScale(.large)
.foregroundStyle(.tint)
VStack {
Text(trashEvent.trash.type)
Text(trashEvent.date.ISO8601Format())
}
}
}
}
.padding()
}
}
#Preview {
MainView()
}