mirror of
https://github.com/NinjaCheetah/RIT-Dining.git
synced 2026-03-05 05:25:29 -05:00
Replace all instances of "RIT Dining" with "TigerDine"
The project and some files were still named that way, so that's been fixed now. The bundle ID is stuck that way forever but oh well. Nobody will see that.
This commit is contained in:
61
TigerDine/Views/Menus/MenuDietaryRestrictionsSheet.swift
Normal file
61
TigerDine/Views/Menus/MenuDietaryRestrictionsSheet.swift
Normal file
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// MenuDietaryRestrictionsSheet.swift
|
||||
// TigerDine
|
||||
//
|
||||
// Created by Campbell on 11/11/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MenuDietaryRestrictionsSheet: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
@ObservedObject var dietaryRestrictionsModel: MenuDietaryRestrictionsModel
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Form {
|
||||
Section(header: Text("Diet")) {
|
||||
Toggle(isOn: $dietaryRestrictionsModel.noBeef) {
|
||||
Text("No Beef")
|
||||
}
|
||||
Toggle(isOn: $dietaryRestrictionsModel.noPork) {
|
||||
Text("No Pork")
|
||||
}
|
||||
Toggle(isOn: $dietaryRestrictionsModel.isVegetarian) {
|
||||
Text("Vegetarian")
|
||||
}
|
||||
Toggle(isOn: $dietaryRestrictionsModel.isVegan) {
|
||||
Text("Vegan")
|
||||
}
|
||||
}
|
||||
Section(header: Text("Allergens")) {
|
||||
ForEach(Allergen.allCases, id: \.self) { allergen in
|
||||
Toggle(isOn: Binding(
|
||||
get: {
|
||||
dietaryRestrictionsModel.dietaryRestrictions.contains(allergen)
|
||||
},
|
||||
set: { isOn in
|
||||
if isOn {
|
||||
dietaryRestrictionsModel.dietaryRestrictions.add(allergen)
|
||||
} else {
|
||||
dietaryRestrictionsModel.dietaryRestrictions.remove(allergen)
|
||||
}
|
||||
}
|
||||
)) {
|
||||
Text(allergen.rawValue.capitalized)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Menu Filters")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
Button(action: {
|
||||
dismiss()
|
||||
}) {
|
||||
Image(systemName: "xmark")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user