mirror of
https://github.com/NinjaCheetah/RIT-Dining.git
synced 2025-12-02 01:21:35 -05:00
There is now a filter button by the search bar in the menu view for locations! This opens a menu that allows you to filter by diets and to filter out any allergens that you need to avoid. These options are all written to UserDefaults, allowing you to set your options once and have them persist across menus and sessions. Also started on some refactors, these will be furthered in a later commit.
110 lines
4.4 KiB
Swift
110 lines
4.4 KiB
Swift
//
|
|
// DonationView.swift
|
|
// RIT Dining
|
|
//
|
|
// Created by Campbell on 9/17/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct DonationView: View {
|
|
@Environment(\.dismiss) var dismiss
|
|
@Environment(\.openURL) private var openURL
|
|
@State private var symbolDrawn: Bool = true
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
VStack(alignment: .center, spacing: 12) {
|
|
HStack {
|
|
if #available(iOS 26.0, *) {
|
|
Image(systemName: "heart.fill")
|
|
.foregroundStyle(.red)
|
|
.symbolEffect(.drawOn, isActive: symbolDrawn)
|
|
.onAppear {
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.75) {
|
|
symbolDrawn = false
|
|
}
|
|
}
|
|
} else {
|
|
Image(systemName: "heart.fill")
|
|
.foregroundStyle(.red)
|
|
}
|
|
Text("Donate")
|
|
.fontWeight(.bold)
|
|
}
|
|
.font(.title)
|
|
Text("The TigerDine app is free and open source software!")
|
|
.fontWeight(.bold)
|
|
.multilineTextAlignment(.center)
|
|
Text("However, the Apple Developer Program is expensive, and I paid $106.19 pretty much just to distribute this app and nothing else. If you can, I'd appreciate it if you wouldn't mind tossing a coin or two my way to help and make that expense a little less painful.")
|
|
.multilineTextAlignment(.center)
|
|
Text("No pressure though.")
|
|
.foregroundStyle(.secondary)
|
|
Button(action: {
|
|
openURL(URL(string: "https://ko-fi.com/ninjacheetah")!)
|
|
}) {
|
|
HStack(alignment: .center) {
|
|
Image("kofiLogo")
|
|
.resizable()
|
|
.frame(width: 50, height: 50)
|
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
|
VStack(alignment: .leading) {
|
|
Text("Tip Me on Ko-fi")
|
|
.fontWeight(.bold)
|
|
Text("Chip in as much or as little as you'd like!")
|
|
.foregroundStyle(.secondary)
|
|
.multilineTextAlignment(.leading)
|
|
}
|
|
Spacer()
|
|
Image(systemName: "chevron.forward")
|
|
}
|
|
.padding(.all, 6)
|
|
.background (
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.fill(Color.secondary.opacity(0.1))
|
|
)
|
|
}
|
|
.buttonStyle(.plain)
|
|
Button(action: {
|
|
openURL(URL(string: "https://paypal.me/NinjaCheetahX")!)
|
|
}) {
|
|
HStack(alignment: .center) {
|
|
Image("paypalLogo")
|
|
.resizable()
|
|
.frame(width: 50, height: 50)
|
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
|
VStack(alignment: .leading) {
|
|
Text("Send Me Money Directly")
|
|
.fontWeight(.bold)
|
|
Text("I have nothing specific to say here!")
|
|
.foregroundStyle(.secondary)
|
|
.multilineTextAlignment(.leading)
|
|
}
|
|
Spacer()
|
|
Image(systemName: "chevron.forward")
|
|
}
|
|
.padding(.all, 6)
|
|
.background (
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.fill(Color.secondary.opacity(0.1))
|
|
)
|
|
}
|
|
.buttonStyle(.plain)
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
.toolbar {
|
|
Button(action: {
|
|
dismiss()
|
|
}) {
|
|
Image(systemName: "xmark")
|
|
}
|
|
}
|
|
}
|
|
.padding(.horizontal, 10)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
DonationView()
|
|
}
|