Started work on refactors

- The favorites model now lives inside of the base dining model, since it was only ever used in places where the main dining model was also available and is only relevant when the dining model is available.
- Removed unnecessary instances of models that were going unused.
- Moved the favorite/map/menu buttons in the top right of the DetailView into the right side toolbar.
  - This frees up a good bit of space at the top of the DetailView and looks cleaner, especially with iOS 26's new toolbar style.
- Actually added a copyright string to the about screen.
More refactors, both internally and for the UI, will be coming soon.
This commit is contained in:
2026-01-07 19:29:30 -05:00
parent 6794c66c37
commit d3d060b5e2
11 changed files with 186 additions and 156 deletions

View File

@@ -11,14 +11,12 @@ struct ContentView: View {
// Save sort/filter options in AppStorage so that they actually get saved.
@AppStorage("openLocationsOnly") var openLocationsOnly: Bool = false
@AppStorage("openLocationsFirst") var openLocationsFirst: Bool = false
@State private var favorites = Favorites()
@State private var notifyingChefs = NotifyingChefs()
@State private var model = DiningModel()
@State private var isLoading: Bool = true
@State private var loadFailed: Bool = false
@State private var showingDonationSheet: Bool = false
@State private var rotationDegrees: Double = 0
@State private var diningLocations: [DiningLocation] = []
@State private var searchText: String = ""
private var animation: Animation {
@@ -176,8 +174,6 @@ struct ContentView: View {
}
}
}
.environment(favorites)
.environment(notifyingChefs)
.environment(model)
.task {
await getDiningData()