mirror of
https://github.com/NinjaCheetah/RIT-Dining.git
synced 2026-01-17 12:05:57 -05:00
- 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.
114 lines
4.5 KiB
Swift
114 lines
4.5 KiB
Swift
//
|
|
// DonationView.swift
|
|
// TigerDine
|
|
//
|
|
// 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) {
|
|
if #available(iOS 26.0, *) {
|
|
Image(systemName: "heart.fill")
|
|
.resizable()
|
|
.scaledToFit()
|
|
.frame(width: 50, height: 50)
|
|
.foregroundStyle(.red)
|
|
.symbolEffect(.drawOn, isActive: symbolDrawn)
|
|
.onAppear {
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.75) {
|
|
symbolDrawn = false
|
|
}
|
|
}
|
|
} else {
|
|
Image(systemName: "heart.fill")
|
|
.resizable()
|
|
.scaledToFit()
|
|
.frame(width: 50, height: 50)
|
|
.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("PayPal won't take a cut!")
|
|
.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)
|
|
.toolbar {
|
|
Button(action: {
|
|
dismiss()
|
|
}) {
|
|
Image(systemName: "xmark")
|
|
}
|
|
}
|
|
}
|
|
.padding(.horizontal, 10)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
DonationView()
|
|
}
|