Refactor and add legal links to payment pages, change contribute view's layout
This commit is contained in:
@@ -36,6 +36,7 @@ Please also consider donating financially if you can. 💕
|
||||
|
||||
|
||||
|
||||
|
||||
private var recurringIAPs = ["TierThree"]
|
||||
|
||||
@EnvironmentObject var transactions: TransactionObserver
|
||||
@@ -49,8 +50,16 @@ Please also consider donating financially if you can. 💕
|
||||
Text(supportString)
|
||||
.padding(16)
|
||||
Spacer()
|
||||
|
||||
// Link("Source Code", destination: URL(string: "https://git.corrupt.link/maddiefuzz/TokiTrainer")!)
|
||||
// .padding(12)
|
||||
|
||||
// .padding([.bottom], 12)
|
||||
HStack {
|
||||
ReviewButton()
|
||||
SourceCodeButton()
|
||||
}
|
||||
HStack {
|
||||
SingleDonationButton()
|
||||
RecurringDonationButton()
|
||||
}
|
||||
@@ -82,6 +91,21 @@ struct ThankYouBannerView: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct SourceCodeButton: View {
|
||||
var body: some View {
|
||||
Link(destination: URL(string: "https://git.corrupt.link/maddiefuzz/TokiTrainer")!) {
|
||||
VStack {
|
||||
Image(systemName: "apple.terminal")
|
||||
.font(.system(size: 24, weight: .regular))
|
||||
.padding(2)
|
||||
Text("Source Code")
|
||||
}
|
||||
}
|
||||
.frame(width: 100)
|
||||
.padding(8)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: ReviewButton
|
||||
struct ReviewButton: View {
|
||||
@Environment(\.requestReview) private var requestReview
|
||||
@@ -98,7 +122,7 @@ struct ReviewButton: View {
|
||||
Text("Write Review")
|
||||
}
|
||||
})
|
||||
.frame(width: 80)
|
||||
.frame(width: 100)
|
||||
.padding(8)
|
||||
}
|
||||
|
||||
@@ -144,42 +168,51 @@ struct SingleDonationButton: View {
|
||||
Text("Donate Once")
|
||||
}
|
||||
}
|
||||
.frame(width: 80)
|
||||
.frame(width: 100)
|
||||
.padding(8)
|
||||
.sheet(item: self.$IAPs) { IAPs in
|
||||
if(productsFetched) {
|
||||
Text("One-Time Donation")
|
||||
.font(.largeTitle)
|
||||
ForEach(IAPs.products) { product in
|
||||
HStack {
|
||||
VStack {
|
||||
Text(product.displayName)
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Text(product.description)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.padding(.leading, 12)
|
||||
Spacer()
|
||||
Button {
|
||||
print("Purchase this one: \(product)")
|
||||
disabledPurchaseButtons = true
|
||||
Task {
|
||||
let _ = try? await purchase(product)
|
||||
disabledPurchaseButtons = false
|
||||
VStack {
|
||||
Spacer()
|
||||
Text("One-Time Donation")
|
||||
.font(.largeTitle)
|
||||
Spacer()
|
||||
ForEach(IAPs.products) { product in
|
||||
HStack {
|
||||
VStack {
|
||||
Text(product.displayName)
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Text(product.description)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
} label: {
|
||||
Text(product.displayPrice)
|
||||
.frame(minWidth: 50)
|
||||
.padding(8)
|
||||
.fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
|
||||
.padding(.leading, 12)
|
||||
Spacer()
|
||||
Button {
|
||||
print("Purchase this one: \(product)")
|
||||
disabledPurchaseButtons = true
|
||||
Task {
|
||||
let _ = try? await purchase(product)
|
||||
disabledPurchaseButtons = false
|
||||
}
|
||||
} label: {
|
||||
Text(product.displayPrice)
|
||||
.frame(minWidth: 50)
|
||||
.padding(8)
|
||||
.fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
.padding(.trailing, 12)
|
||||
.buttonStyle(.bordered)
|
||||
.disabled(disabledPurchaseButtons)
|
||||
}
|
||||
.padding(.trailing, 12)
|
||||
.buttonStyle(.bordered)
|
||||
.disabled(disabledPurchaseButtons)
|
||||
.padding(12)
|
||||
}
|
||||
.padding(12)
|
||||
Spacer()
|
||||
LegalLinksView()
|
||||
.padding(16)
|
||||
.padding([.bottom], 20)
|
||||
}
|
||||
//.padding([.top], 60)
|
||||
} else {
|
||||
ProgressView()
|
||||
}
|
||||
@@ -244,14 +277,35 @@ struct RecurringDonationButton: View {
|
||||
Text("Donate Monthly")
|
||||
}
|
||||
}
|
||||
.frame(width: 80)
|
||||
.frame(width: 100)
|
||||
.padding(8)
|
||||
.sheet(isPresented: $toggleSheet, content: {
|
||||
SubscriptionStoreView(groupID: self.groupID)
|
||||
VStack {
|
||||
SubscriptionStoreView(groupID: self.groupID)
|
||||
// HStack {
|
||||
// Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
|
||||
// .padding(12)
|
||||
// Link("Privacy Policy", destination: URL(string: "https://maddie.info/null_privacy_policy")!)
|
||||
// }
|
||||
LegalLinksView()
|
||||
.padding(16)
|
||||
.padding([.bottom], 20)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct LegalLinksView: View {
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
|
||||
.padding(12)
|
||||
Link("Privacy Policy", destination: URL(string: "https://maddie.info/null_privacy_policy")!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContributeView().environmentObject(TransactionObserver())
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ struct DictionaryView: View {
|
||||
})
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
.padding([.top, .leading, .trailing], 8)
|
||||
.padding([.top, .leading, .trailing], 16)
|
||||
if advancedSearchEnabled == true {
|
||||
VStack {
|
||||
Text("Search for:")
|
||||
@@ -88,7 +88,7 @@ struct DictionaryView: View {
|
||||
.sheet(isPresented: $showGenericLegend, content: {
|
||||
PartsOfSpeechView(selectedPartOfSpeech: nil)
|
||||
})
|
||||
.onChange(of: tokiInput) { newValue in
|
||||
.onChange(of: tokiInput) {
|
||||
filterByInput()
|
||||
//tokiDictViewModel.filterDictionaryEnglishMode(newValue)
|
||||
}
|
||||
|
@@ -31,8 +31,8 @@ struct TranslatorView: View {
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.padding([.top, .leading, .trailing], 8)
|
||||
|
||||
.padding([.top, .leading, .trailing], 16)
|
||||
|
||||
if tokiInput.count == 0 {
|
||||
List(tokiDictViewModel.dictionary, id: \.word) { entry in
|
||||
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: $selectedPartOfSpeech)
|
||||
@@ -52,8 +52,8 @@ struct TranslatorView: View {
|
||||
.sheet(item: $selectedPartOfSpeech) { selectedPOS in
|
||||
PartsOfSpeechView(selectedPartOfSpeech: selectedPOS)
|
||||
}
|
||||
.onChange(of: tokiInput) { newValue in
|
||||
tokiDictViewModel.translatePhrase(newValue)
|
||||
.onChange(of: tokiInput) {
|
||||
tokiDictViewModel.translatePhrase(tokiInput)
|
||||
}
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
|
Reference in New Issue
Block a user