purple: disable apple IAP ui by default

We do not have Apple In-app purchases ready for the upcoming release.

This commit hides IAP UI/UX behind a developer feature flag which is off
by default, and shows a link inviting the user to visit the website to
learn more.

It also makes the link go to the normal Damus website.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Daniel D’Aquino
2024-01-30 07:41:56 +00:00
committed by William Casarin
parent e649c49981
commit cdd5327829
4 changed files with 31 additions and 14 deletions

View File

@@ -362,18 +362,20 @@ struct DamusPurpleView: View {
var ProductStateView: some View {
Group {
switch self.products {
case .failed:
ProductLoadError
case .loaded(let products):
if let purchased {
PurchasedView(purchased)
} else {
ProductsView(products)
}
case .loading:
ProgressView()
.progressViewStyle(.circular)
if damus_state.purple.enable_purple_iap_support {
switch self.products {
case .failed:
ProductLoadError
case .loaded(let products):
if let purchased {
PurchasedView(purchased)
} else {
ProductsView(products)
}
case .loading:
ProgressView()
.progressViewStyle(.circular)
}
}
}
}
@@ -457,8 +459,11 @@ struct DamusPurpleView: View {
HStack {
Spacer()
Link(
NSLocalizedString("Learn more", comment: "Label for a link to the Damus Purple landing page"),
destination: damus_state.purple.environment.purple_landing_page_url()
damus_state.purple.enable_purple_iap_support ?
NSLocalizedString("Learn more about the features", comment: "Label for a link to the Damus website, to allow the user to learn more about the features of Purple")
:
NSLocalizedString("Coming soon! Visit our website to learn more", comment: "Label announcing Purple, and inviting the user to learn more on the website"),
destination: damus_state.purple.environment.damus_website_url()
)
.foregroundColor(DamusColors.pink)
.padding()