Skip to content

Commit

Permalink
Legal
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed May 3, 2020
1 parent 85cc745 commit 8bb0eb6
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 55 deletions.
4 changes: 2 additions & 2 deletions ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ACHNBrowserUI/ACHNBrowserUI.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 050322020;
CURRENT_PROJECT_VERSION = 050332020;
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_PREVIEWS = YES;
Expand All @@ -1436,7 +1436,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ACHNBrowserUI/ACHNBrowserUI.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 050322020;
CURRENT_PROJECT_VERSION = 050332020;
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_PREVIEWS = YES;
Expand Down
3 changes: 3 additions & 0 deletions ACHNBrowserUI/ACHNBrowserUI/views/about/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ struct AboutView: View {
makeRow(image: "lock", text: "Privacy Policy", color: .bell).onTapGesture {
self.selectedSheet = .safari(URL(string: "https://github.com/Dimillian/ACHNBrowserUI/blob/master/privacy-policy.md#ac-helper-privacy-policy")!)
}
makeRow(image: "person", text: "Term of Use", color: .bell).onTapGesture {
self.selectedSheet = .safari(URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
}
}
Section(header: SectionHeaderView(text: "Acknowledgements")) {
makeRow(image: "suit.heart.fill", text: "Our amazing contributors", color: .red)
Expand Down
157 changes: 104 additions & 53 deletions ACHNBrowserUI/ACHNBrowserUI/views/subscription/SubscribeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ struct SubscribeView: View {
@EnvironmentObject private var subscriptionManager: SubcriptionManager
@Environment(\.presentationMode) private var presentationMode

@State private var sheetURL: URL?

private var sub: Purchases.Package? {
subscriptionManager.subscription
}
Expand All @@ -33,27 +35,22 @@ struct SubscribeView: View {
}
}

var body: some View {
NavigationView {
ScrollView(.vertical) {
ZStack {
Color.dialogueReverse.edgesIgnoringSafeArea(.all)
if sub != nil {
VStack {
HStack(alignment: .center, spacing: 4) {
Text("Upgrade to +")
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.bell)
Image("icon-bell")
}
.padding(.top, 32)
Image("notification")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 320)
.padding()
Text("""
private var upperPart: some View {
Group {
HStack(alignment: .center, spacing: 4) {
Text("Upgrade to +")
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.bell)
Image("icon-bell")
}
.padding(.top, 32)
Image("notification")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 320)
.padding()
Text("""
Subscribing to AC Helper+ is a great way to to show support to our free and open source project.♥️
You also get access to a great feature, turnip predictions notifications! 📈
Expand All @@ -63,44 +60,98 @@ struct SubscribeView: View {
The more in game daily prices you enter after monday morning, the better next predictions will be!
""")
.font(.body)
.foregroundColor(.text)
.frame(width: 320)
.padding()
.lineLimit(nil)
Button(action: {
if self.subscriptionManager.subscriptionStatus == .subscribed {
self.presentationMode.wrappedValue.dismiss()
} else {
self.subscriptionManager.puschase(product: self.sub!)
}
}) {
Group {
if self.subscriptionManager.subscriptionStatus == .subscribed {
Text("Thanks you for your support!")
.fontWeight(.bold)
.foregroundColor(.white)
} else {
Text("Subscribe for \(price) / Month")
.fontWeight(.bold)
.foregroundColor(.white)
}
}
.font(.headline)
.frame(width: 320, height: 50)
.background(Color.grass)
.cornerRadius(8)
}
.opacity(subscriptionManager.inPaymentProgress ? 0.5 : 1.0)
.disabled(subscriptionManager.inPaymentProgress)
Spacer(minLength: 300)
}.background(Color.dialogueReverse.edgesIgnoringSafeArea(.all))
.font(.body)
.foregroundColor(.text)
.frame(width: 320)
.padding()
.lineLimit(nil)
Button(action: {
if self.subscriptionManager.subscriptionStatus == .subscribed {
self.presentationMode.wrappedValue.dismiss()
} else {
self.subscriptionManager.puschase(product: self.sub!)
}
}) {
Group {
if self.subscriptionManager.subscriptionStatus == .subscribed {
Text("Thanks you for your support!")
.fontWeight(.bold)
.foregroundColor(.white)
} else {
Text("Subscribe for \(price) / Month")
.fontWeight(.bold)
.foregroundColor(.white)
}
}
.font(.headline)
.frame(width: 320, height: 50)
.background(Color.grass)
.cornerRadius(8)
}
.opacity(subscriptionManager.inPaymentProgress ? 0.5 : 1.0)
.disabled(subscriptionManager.inPaymentProgress)
}
}

private var lowerPart: some View {
Group {
Text("""
A \(price) per month purchase will be applied to your iTunes account on confirmation.
Subscriptions will automatically renew unless canceled within 24-hours before the end of the current period.
You can cancel anytime with your iTunes account settings. Any unused portion of a free trial will be forfeited if you purchase a subscription.
""")
.font(.caption)
.foregroundColor(.text)
.frame(width: 320)
.padding()
.lineLimit(nil)
Spacer(minLength: 16)
Button(action: {
self.sheetURL = URL(string: "https://github.com/Dimillian/ACHNBrowserUI/blob/master/privacy-policy.md#ac-helper-privacy-policy")
}) {
Text("Privacy policy")
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.frame(width: 320, height: 50)
.background(Color.grass)
.cornerRadius(8)
}
Spacer(minLength: 16)
Button(action: {
self.sheetURL = URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")
}) {
Text("Term of use")
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.frame(width: 320, height: 50)
.background(Color.grass)
.cornerRadius(8)
}

Spacer(minLength: 300)
}.background(Color.dialogueReverse.edgesIgnoringSafeArea(.all))
}

var body: some View {
NavigationView {
ScrollView(.vertical) {
ZStack {
Color.dialogueReverse.edgesIgnoringSafeArea(.all)
if sub != nil {
VStack {
upperPart
Spacer(minLength: 32)
lowerPart
}
} else {
Text("Loading...")
Spacer()
}
}
}
.sheet(item: $sheetURL, content: { SafariView(url: $0) })
.navigationBarItems(trailing: dismissButton)
.navigationBarTitle(Text("AC Helper+"),
displayMode: .inline)
Expand Down

0 comments on commit 8bb0eb6

Please sign in to comment.