diff --git a/apps/ios/Shared/Views/Badges/BadgesSupportSimplexView.swift b/apps/ios/Shared/Views/Badges/BadgesSupportSimplexView.swift index 97e91bfb69..df13abdc97 100644 --- a/apps/ios/Shared/Views/Badges/BadgesSupportSimplexView.swift +++ b/apps/ios/Shared/Views/Badges/BadgesSupportSimplexView.swift @@ -45,25 +45,15 @@ struct BadgesSupportSimplexView: View { Spacer(minLength: 0) - // In-app purchase is not released: the badge is chosen on the site, and the code - // redeemed here. Revert this commit to restore the block below. - // VStack(spacing: 10) { - // chooseLevelButton() - // .padding(.vertical, 10) - // Group { - // if badgeBrowserAllowed { - // buyInBrowserButton() - // } else { - // RedeemCodeButton() - // } - // } - // .frame(height: 22) - // } VStack(spacing: 10) { - chooseBadgeOnSiteButton() + chooseLevelButton() .padding(.vertical, 10) Group { - RedeemCodeButton() + if badgeBrowserAllowed { + buyInBrowserButton() + } else { + RedeemCodeButton() + } } .frame(height: 22) } @@ -141,16 +131,6 @@ struct BadgesSupportSimplexView: View { } } - // In-app purchase is not released: delete with the commented block above to restore it. - private func chooseBadgeOnSiteButton() -> some View { - Button { - UIApplication.shared.open(URL(string: badgePageUrl)!) - } label: { - Text("Choose your badge") - } - .buttonStyle(OnboardingButtonStyle(isDisabled: false)) - } - private func buyInBrowserButton() -> some View { Button { UIApplication.shared.open(URL(string: badgePageUrl)!) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesSupportSimplexView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesSupportSimplexView.kt index c0e1c968b9..f81d561120 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesSupportSimplexView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesSupportSimplexView.kt @@ -63,24 +63,18 @@ fun BadgesSupportSimplexView(modalManager: ModalManager, unwindToDepth: Int) { Spacer(Modifier.weight(1f)) - // In-app purchase is not released: the badge is chosen on the site, and the code redeemed - // here. Revert this commit to restore the block below. - // Column(horizontalAlignment = Alignment.CenterHorizontally) { - // if (badgeStoreAvailable) { - // ChooseLevelButton(modalManager, unwindToDepth) - // if (badgeBrowserAllowed()) { - // BuyInBrowserTextButton() - // } else { - // RedeemCodeButton(modalManager, unwindToDepth) - // } - // } else { - // BuyInBrowserButton(modalManager, unwindToDepth) - // RedeemCodeButton(modalManager, unwindToDepth) - // } - // } Column(horizontalAlignment = Alignment.CenterHorizontally) { - ChooseBadgeOnSiteButton(modalManager, unwindToDepth) - RedeemCodeButton(modalManager, unwindToDepth) + if (badgeStoreAvailable) { + ChooseLevelButton(modalManager, unwindToDepth) + if (badgeBrowserAllowed()) { + BuyInBrowserTextButton() + } else { + RedeemCodeButton(modalManager, unwindToDepth) + } + } else { + BuyInBrowserButton(modalManager, unwindToDepth) + RedeemCodeButton(modalManager, unwindToDepth) + } } } } @@ -140,25 +134,6 @@ private fun BuyInBrowserTextButton() { ) } -// In-app purchase is not released: delete with the commented block above to restore it. -@Composable -private fun ChooseBadgeOnSiteButton(modalManager: ModalManager, unwindToDepth: Int) { - val uriHandler = LocalUriHandler.current - OnboardingActionButton( - modifier = if (appPlatform.isAndroid) Modifier.padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING).fillMaxWidth() else Modifier.widthIn(min = 300.dp), - labelId = MR.strings.badges_choose_your_badge_title, - onboarding = null, - onclick = { - val linkReturns = appLinkSchemeRegistered() - uriHandler.openUriCatching(badgePageUrl(linkReturns)) - // with no scheme to bring the code back, the code is pasted into this screen, opened beside the browser - if (!linkReturns && !modalManager.hasModalOpen(ModalViewId.BADGE_REDEEM_CODE)) { - modalManager.showModal(id = ModalViewId.BADGE_REDEEM_CODE) { BadgesRedeemCodeView(modalManager, unwindToDepth) } - } - } - ) -} - @Composable private fun BuyInBrowserButton(modalManager: ModalManager, unwindToDepth: Int) { val uriHandler = LocalUriHandler.current