diff --git a/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewUDDomainsService.swift b/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewUDDomainsService.swift index 1bfd45466..6c90165b2 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewUDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewUDDomainsService.swift @@ -47,10 +47,6 @@ final class UDDomainsService: UDDomainsServiceProtocol { [] } - func getReferralCodeFor(domain: DomainItem) async throws -> String? { - nil - } - func resolveDomainOwnerFor(domainName: DomainName) async -> HexAddress? { nil } diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index d8091939f..dbe2ed044 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -1005,10 +1005,6 @@ C673D59629FA56C1001CC77C /* TransferDomainTransactionInProgressViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D59529FA56C1001CC77C /* TransferDomainTransactionInProgressViewPresenter.swift */; }; C673D59D29FA588B001CC77C /* DomainTransactionInProgressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D59B29FA588B001CC77C /* DomainTransactionInProgressCell.swift */; }; C673D5A129FA588B001CC77C /* DomainTransactionInProgressCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C673D59C29FA588B001CC77C /* DomainTransactionInProgressCell.xib */; }; - C673D5AC29FB725B001CC77C /* InviteFriendsViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5A929FB725B001CC77C /* InviteFriendsViewPresenter.swift */; }; - C673D5B029FB725B001CC77C /* InviteFriendsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5AA29FB725B001CC77C /* InviteFriendsViewController.swift */; }; - C673D5B429FB725B001CC77C /* InviteFriendsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C673D5AB29FB725B001CC77C /* InviteFriendsViewController.xib */; }; - C673D5BA29FB75A7001CC77C /* InviteFriendStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5B929FB75A7001CC77C /* InviteFriendStepView.swift */; }; C674598F280E9CA20074CBE5 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C674598E280E9CA20074CBE5 /* WebViewController.swift */; }; C6752C432B708DF400E54367 /* UserProfileService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6526DB829D2BACB00D6F2EB /* UserProfileService.swift */; }; C6752C462B708E1900E54367 /* UserProfileServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6752C452B708E1900E54367 /* UserProfileServiceProtocol.swift */; }; @@ -1599,10 +1595,6 @@ C6C8F8EB2B21836400A9834D /* ParkedDomainsFoundOnboardingViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6526DF129D2E12A00D6F2EB /* ParkedDomainsFoundOnboardingViewPresenter.swift */; }; C6C8F91A2B2183A400A9834D /* LaunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6637A6F28100D3A0000AE56 /* LaunchViewController.swift */; }; C6C8F91B2B2183A400A9834D /* LaunchViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C6637A7028100D3A0000AE56 /* LaunchViewController.xib */; }; - C6C8F91C2B2183AB00A9834D /* InviteFriendsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C673D5AB29FB725B001CC77C /* InviteFriendsViewController.xib */; }; - C6C8F91D2B2183AB00A9834D /* InviteFriendsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5AA29FB725B001CC77C /* InviteFriendsViewController.swift */; }; - C6C8F91E2B2183AB00A9834D /* InviteFriendStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5B929FB75A7001CC77C /* InviteFriendStepView.swift */; }; - C6C8F91F2B2183AB00A9834D /* InviteFriendsViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C673D5A929FB725B001CC77C /* InviteFriendsViewPresenter.swift */; }; C6C8F9202B2183B700A9834D /* DigitalKeyboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66804B9280D9EC7007E6390 /* DigitalKeyboardViewController.swift */; }; C6C8F9212B2183B700A9834D /* EnterPasscodeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C66804BC280D9EC7007E6390 /* EnterPasscodeViewController.xib */; }; C6C8F9222B2183B700A9834D /* EnterPasscodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66804BE280D9EC7007E6390 /* EnterPasscodeViewController.swift */; }; @@ -3243,10 +3235,6 @@ C673D59529FA56C1001CC77C /* TransferDomainTransactionInProgressViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferDomainTransactionInProgressViewPresenter.swift; sourceTree = ""; }; C673D59B29FA588B001CC77C /* DomainTransactionInProgressCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainTransactionInProgressCell.swift; sourceTree = ""; }; C673D59C29FA588B001CC77C /* DomainTransactionInProgressCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DomainTransactionInProgressCell.xib; sourceTree = ""; }; - C673D5A929FB725B001CC77C /* InviteFriendsViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InviteFriendsViewPresenter.swift; sourceTree = ""; }; - C673D5AA29FB725B001CC77C /* InviteFriendsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InviteFriendsViewController.swift; sourceTree = ""; }; - C673D5AB29FB725B001CC77C /* InviteFriendsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InviteFriendsViewController.xib; sourceTree = ""; }; - C673D5B929FB75A7001CC77C /* InviteFriendStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InviteFriendStepView.swift; sourceTree = ""; }; C674598E280E9CA20074CBE5 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = ""; }; C6752C452B708E1900E54367 /* UserProfileServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileServiceProtocol.swift; sourceTree = ""; }; C679B5EB2918BCDF00F543A7 /* DomainProfileWeb3WebsiteLoadingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainProfileWeb3WebsiteLoadingCell.swift; sourceTree = ""; }; @@ -6292,25 +6280,6 @@ path = DomainTransactionInProgressCell; sourceTree = ""; }; - C673D5A829FB723E001CC77C /* InviteFriends */ = { - isa = PBXGroup; - children = ( - C673D5A929FB725B001CC77C /* InviteFriendsViewPresenter.swift */, - C673D5AA29FB725B001CC77C /* InviteFriendsViewController.swift */, - C673D5AB29FB725B001CC77C /* InviteFriendsViewController.xib */, - C673D5B829FB7266001CC77C /* Views */, - ); - path = InviteFriends; - sourceTree = ""; - }; - C673D5B829FB7266001CC77C /* Views */ = { - isa = PBXGroup; - children = ( - C673D5B929FB75A7001CC77C /* InviteFriendStepView.swift */, - ); - path = Views; - sourceTree = ""; - }; C674598D280E9C560074CBE5 /* WebViewController */ = { isa = PBXGroup; children = ( @@ -7623,7 +7592,6 @@ C66804B7280D9EC7007E6390 /* EnterPasscode */, C6A89C622B31722E008AB043 /* HotFeatureSuggestion */, C685A9782840BF4D00E54044 /* InfoScreen */, - C673D5A829FB723E001CC77C /* InviteFriends */, C6637A6E28100D180000AE56 /* LaunchViewController */, C63DD35D29C89FCB002D45B2 /* LoginViewController */, C65271DD2A148D74001A084C /* Messaging */, @@ -8202,7 +8170,6 @@ C60982F4282A7D7200546392 /* ConfirmWordConfirmationCell.xib in Resources */, C673D57A29FA3645001CC77C /* ReviewAndConfirmTransferViewController.xib in Resources */, C60982D4282A7A8E00546392 /* AddWalletViewController.xib in Resources */, - C673D5B429FB725B001CC77C /* InviteFriendsViewController.xib in Resources */, C60982DE282A7B6B00546392 /* WalletConnectedViewController.xib in Resources */, C685A954284097E600E54044 /* UDDomainCardView.xib in Resources */, C66FCD1E2845C3AE009B9525 /* DomainsCollectionMintingInProgressCell.xib in Resources */, @@ -8435,7 +8402,6 @@ C6D646902B1ED13C00D724AC /* AddCurrencyEmptyCell.xib in Resources */, C6D646F02B1ED5B200D724AC /* AddWalletViewController.xib in Resources */, C6C8F9282B2183C700A9834D /* DomainsCollectionSearchEmptyCell.xib in Resources */, - C6C8F91C2B2183AB00A9834D /* InviteFriendsViewController.xib in Resources */, C6C8F8422B217E9600A9834D /* CreatePasswordViewController.xib in Resources */, C6C8F89E2B2182AE00A9834D /* RenameWalletViewController.xib in Resources */, C6C8F8512B217E9600A9834D /* ConfirmWordConfirmationCell.xib in Resources */, @@ -8606,7 +8572,6 @@ C61C332A2B90527200BD11F5 /* UDSegmentedControlView.swift in Sources */, C6668941281150FA002062B4 /* SecondaryButton.swift in Sources */, C62247BA283CFF23002A0CBD /* MockDomainTransactionsService.swift in Sources */, - C673D5AC29FB725B001CC77C /* InviteFriendsViewPresenter.swift in Sources */, C6D3B9CF2A6EC4AE0091B279 /* XMTPEnvironmentNamespace.swift in Sources */, 306486CD25273C4400388026 /* User.swift in Sources */, C62396A92A28D7D200363F60 /* PushChannel.swift in Sources */, @@ -8842,7 +8807,6 @@ C6FF2DA628F02B1700148007 /* DomainProfileSectionUIChangeType.swift in Sources */, C664311528D95E5F00A9C734 /* OnboardingConnectExternalWalletPresenter.swift in Sources */, C666893728114D7A002062B4 /* LinkButton.swift in Sources */, - C673D5B029FB725B001CC77C /* InviteFriendsViewController.swift in Sources */, C60981D62822565300546392 /* WalletDetailsViewPresenter.swift in Sources */, C69F99212A9F1264004B1958 /* HexagonShape.swift in Sources */, C66689502811717C002062B4 /* PasscodeButton.swift in Sources */, @@ -9253,7 +9217,6 @@ C62C3FA1283F60720094FC93 /* DeepLinksServiceProtocol.swift in Sources */, C664B670291542E300A76154 /* DomainProfileWeb3WebsiteCell.swift in Sources */, C65272212A14B32F001A084C /* MessagingServiceProtocol.swift in Sources */, - C673D5BA29FB75A7001CC77C /* InviteFriendStepView.swift in Sources */, C688C17C2B8443CA00BD233A /* ChatListEmptyStateView.swift in Sources */, 306665E12778AE74005F6F55 /* UnsConfigManager.swift in Sources */, C6B65FAD2B57A5BB006D1812 /* DismissIndicatorView.swift in Sources */, @@ -9906,7 +9869,6 @@ C6D011C02B995AEE0008BF40 /* HomeExploreSuggestedProfileRowView.swift in Sources */, C618086C2B19BC0C0032E543 /* Line.swift in Sources */, C6C8F8A82B2182AE00A9834D /* RenameWalletViewController.swift in Sources */, - C6C8F91D2B2183AB00A9834D /* InviteFriendsViewController.swift in Sources */, C6C8F97C2B2188FA00A9834D /* QRScannerViewPresenter.swift in Sources */, C688C1872B846F1B00BD233A /* ChannelView.swift in Sources */, C6960C352B19962800B79E28 /* BlockchainType.swift in Sources */, @@ -10154,7 +10116,6 @@ C6D647392B1ED9EF00D724AC /* SignMessageRequestConfirmationView.swift in Sources */, C6C8F8E82B21836400A9834D /* NoParkedDomainsFoundViewPresenter.swift in Sources */, C6C8F8272B217D3500A9834D /* WCCompatibleWallet.swift in Sources */, - C6C8F91E2B2183AB00A9834D /* InviteFriendStepView.swift in Sources */, C6D646912B1ED13C00D724AC /* AddCurrencyViewPresenter.swift in Sources */, C65CEB8C2B674FC700A13B34 /* UDWalletsServiceEnvironmentKey.swift in Sources */, C6C8F83D2B217E9600A9834D /* OnboardingBackupWalletPresenter.swift in Sources */, @@ -10257,7 +10218,6 @@ C6D645E42B1DBD9000D724AC /* BaseDiffableCollectionViewControllerProtocol.swift in Sources */, C618081C2B19AB0D0032E543 /* PendingPurchasedDomain.swift in Sources */, C6D646B02B1ED17E00D724AC /* SocialsDomainImagePreviewView.swift in Sources */, - C6C8F91F2B2183AB00A9834D /* InviteFriendsViewPresenter.swift in Sources */, C6D646932B1ED14400D724AC /* DomainProfileFetchFailedActionCoverViewPresenter.swift in Sources */, C61808482B19B9680032E543 /* PreviewAppLaunchService.swift in Sources */, C62BDA422B5E4104008E21AD /* MessagingBlockUserInChatType.swift in Sources */, diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+Domains.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+Domains.swift index 5f870f1f5..060634281 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+Domains.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+Domains.swift @@ -120,7 +120,6 @@ extension MockEntitiesFabric { .init(profile: attributes, metadata: createPublicDomainMetadata(domain: domain, walletAddress: walletAddress), socialAccounts: socialAccounts, - referralCode: nil, social: social, records: nil, walletBalances: walletBalance) diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift index 547642452..9821f9acd 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift @@ -434,7 +434,6 @@ extension String { static let settingsFollowTwitter = "SETTINGS_FOLLOW_TWITTER" static let settingsSupportNFeedback = "SETTINGS_SUPPORT_N_FEEDBACK" static let settingsLegal = "SETTINGS_LEGAL" - static let settingsInviteFriends = "SETTINGS_INVITE_FRIENDS" static let settingsSecurityPasscode = "SETTINGS_SECURITY_PASSCODE" static let settingsSecurityChangePasscode = "SETTINGS_SECURITY_CHANGE_PASSCODE" @@ -900,13 +899,6 @@ extension String { static let clearRecordsUponTransfer = "CLEAR_RECORDS_UPON_TRANSFER" static let optional = "OPTIONAL" static let transferInProgress = "TRANSFER_IN_PROGRESS" - - // Referral - static let inviteFriendsTitle = "INVITE_FRIENDS_TITLE" - static let inviteFriendsSubtitle = "INVITE_FRIENDS_SUBTITLE" - static let inviteFriendsStep1Message = "INVITE_FRIENDS_STEP_1_MESSAGE" - static let inviteFriendsStep2Message = "INVITE_FRIENDS_STEP_2_MESSAGE" - static let inviteFriendsStep3Message = "INVITE_FRIENDS_STEP_3_MESSAGE" static let copyLink = "COPY_LINK" // Apple Pay required diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.swift b/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.swift deleted file mode 100644 index 6ed34ed00..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// InviteFriendsViewController.swift -// domains-manager-ios -// -// Created by Oleg Kuplin on 28.04.2023. -// - -import UIKit - -@MainActor -protocol InviteFriendsViewProtocol: BaseViewControllerProtocol { - -} - -@MainActor -final class InviteFriendsViewController: BaseViewController { - - @IBOutlet private weak var titleLabel: UDTitleLabel! - @IBOutlet private weak var subtitleLabel: UDSubtitleLabel! - @IBOutlet private weak var copyLinkButton: UDConfigurableButton! - @IBOutlet private weak var shareButton: MainButton! - @IBOutlet private weak var stepsStackView: UIStackView! - - override var analyticsName: Analytics.ViewName { .inviteFriends } - var presenter: InviteFriendsViewPresenterProtocol! - - override func viewDidLoad() { - super.viewDidLoad() - - setup() - presenter.viewDidLoad() - } - - -} - -// MARK: - InviteFriendsViewProtocol -extension InviteFriendsViewController: InviteFriendsViewProtocol { - -} - -// MARK: - Actions -private extension InviteFriendsViewController { - @IBAction func copyLinkButtonPressed(_ sender: Any) { - logButtonPressedAnalyticEvents(button: .copyLink) - presenter.copyLinkButtonPressed() - } - - @IBAction func shareButtonPressed(_ sender: Any) { - logButtonPressedAnalyticEvents(button: .share) - presenter.shareButtonPressed() - } - - @objc func infoButtonPressed() { - logButtonPressedAnalyticEvents(button: .inviteFriendInfo) - presenter.infoButtonPressed() - } -} - -// MARK: - Private functions -private extension InviteFriendsViewController { - -} - -// MARK: - Setup functions -private extension InviteFriendsViewController { - func setup() { - view.backgroundColor = .backgroundDefault - localizeContent() - setupNavigationItems() - setupSteps() - } - - func localizeContent() { - copyLinkButton.setConfiguration(.largeGhostPrimaryButtonConfiguration) - copyLinkButton.setTitle(String.Constants.copyLink.localized(), image: nil) - shareButton.setTitle(String.Constants.share.localized(), image: nil) - - titleLabel.setTitle(String.Constants.inviteFriendsTitle.localized()) - subtitleLabel.setSubtitle(String.Constants.inviteFriendsSubtitle.localized()) - } - - func setupNavigationItems() { - let infoButton = UIBarButtonItem(image: .helpCircleIcon24, - style: .plain, - target: self, action: #selector(infoButtonPressed)) - infoButton.tintColor = .foregroundDefault - navigationItem.rightBarButtonItem = infoButton - } - - func setupSteps() { - stepsStackView.removeArrangedSubviews() - - let steps = InviteFriendStep.allCases - - for step in steps { - let stepView = InviteFriendStepView(frame: .zero) - stepView.translatesAutoresizingMaskIntoConstraints = false - stepsStackView.addArrangedSubview(stepView) - stepView.setWithStep(step) - } - } -} - -extension InviteFriendsViewController { - enum InviteFriendStep: Int, CaseIterable { - case step1 = 1 - case step2 = 2 - case step3 = 3 - - var message: String { - switch self { - case .step1: - return String.Constants.inviteFriendsStep1Message.localized() - case .step2: - return String.Constants.inviteFriendsStep2Message.localized() - case .step3: - return String.Constants.inviteFriendsStep3Message.localized() - } - } - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.xib b/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.xib deleted file mode 100644 index d132d958e..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewController.xib +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewPresenter.swift b/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewPresenter.swift deleted file mode 100644 index 39efa0b83..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/InviteFriendsViewPresenter.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// InviteFriendsViewPresenter.swift -// domains-manager-ios -// -// Created by Oleg Kuplin on 28.04.2023. -// - -import UIKit - -@MainActor -protocol InviteFriendsViewPresenterProtocol: BasePresenterProtocol { - func copyLinkButtonPressed() - func shareButtonPressed() - func infoButtonPressed() -} - -final class InviteFriendsViewPresenter { - - private weak var view: InviteFriendsViewProtocol? - private let domain: DomainItem - private var referralCode: String? - - init(view: InviteFriendsViewProtocol, - domain: DomainItem) { - self.view = view - self.domain = domain - preloadReferralCodeAsync() - } -} - -// MARK: - InviteFriendsViewPresenterProtocol -extension InviteFriendsViewPresenter: InviteFriendsViewPresenterProtocol { - func copyLinkButtonPressed() { - Task { - guard let code = await getReferralCode() else { return } - - let link = String.Links.referralLink(code: code) - UIPasteboard.general.string = link.urlString - appContext.toastMessageService.showToast(.itemCopied(name: String.Constants.link.localized()), isSticky: false) - } - } - - func shareButtonPressed() { - Task { - guard let code = await getReferralCode() else { return } - - let link = String.Links.referralLink(code: code) - guard let url = link.url else { return } - - let activityViewController = UIActivityViewController(activityItems: [url], - applicationActivities: nil) - view?.present(activityViewController, animated: true) - } - } - - func infoButtonPressed() { - view?.openLink(.referralTutorial) - } -} - -// MARK: - Private functions -private extension InviteFriendsViewPresenter { - func preloadReferralCodeAsync() { - Task { - referralCode = try? await loadReferralCode() - } - } - - func loadReferralCode() async throws -> String? { - try await appContext.udDomainsService.getReferralCodeFor(domain: domain) - } - - func getReferralCode() async -> String? { - do { - if let referralCode { - return referralCode - } - let code = try await loadReferralCode() - - if let code { - self.referralCode = code - } else { - await showFailedToLoadReferralCode() - } - - return code - } catch { - await showFailedToLoadReferralCode() - return nil - } - } - - @MainActor - func showFailedToLoadReferralCode() { - view?.showSimpleAlert(title: String.Constants.error.localized(), - body: String.Constants.pleaseCheckInternetConnection.localized()) - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/Views/InviteFriendStepView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/Views/InviteFriendStepView.swift deleted file mode 100644 index 0b4e19c3d..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Modules/InviteFriends/Views/InviteFriendStepView.swift +++ /dev/null @@ -1,85 +0,0 @@ -// -// InviteFriendStepView.swift -// domains-manager-ios -// -// Created by Oleg Kuplin on 28.04.2023. -// - -import UIKit - -final class InviteFriendStepView: UIView { - - private var contentStack: UIStackView! - private var numberContainerView: UIView! - private var numberLabel: UILabel! - private var messageLabel: UILabel! - - override init(frame: CGRect) { - super.init(frame: frame) - - setup() - } - - required init?(coder: NSCoder) { - super.init(coder: coder) - - setup() - } - -} - -// MARK: - Open methods -extension InviteFriendStepView { - func setWithStep(_ step: InviteFriendsViewController.InviteFriendStep) { - numberLabel.setAttributedTextWith(text: String(step.rawValue), - font: .currentFont(withSize: 16, weight: .medium), - textColor: .foregroundDefault) - messageLabel.setAttributedTextWith(text: step.message, - font: .currentFont(withSize: 16, weight: .medium), - textColor: .foregroundDefault, - lineHeight: 24) - } -} - -// MARK: - Setup methods -private extension InviteFriendStepView { - func setup() { - setupNumberViews() - setupMessageLabel() - setupContentStack() - } - - func setupNumberViews() { - numberContainerView = UIView() - numberContainerView.translatesAutoresizingMaskIntoConstraints = false - let size: CGFloat = 40 - numberContainerView.backgroundColor = .backgroundMuted2 - numberContainerView.layer.cornerRadius = size / 2 - numberContainerView.layer.borderWidth = 1 - numberContainerView.layer.borderColor = UIColor.borderSubtle.cgColor - - numberLabel = UILabel() - numberLabel.translatesAutoresizingMaskIntoConstraints = false - numberContainerView.addSubview(numberLabel) - - NSLayoutConstraint.activate([numberContainerView.heightAnchor.constraint(equalToConstant: size), - numberContainerView.widthAnchor.constraint(equalTo: numberContainerView.heightAnchor, multiplier: 1), - numberLabel.centerXAnchor.constraint(equalTo: numberContainerView.centerXAnchor), - numberLabel.centerYAnchor.constraint(equalTo: numberContainerView.centerYAnchor)]) - - } - - func setupMessageLabel() { - messageLabel = UILabel() - messageLabel.translatesAutoresizingMaskIntoConstraints = false - messageLabel.numberOfLines = 0 - } - - func setupContentStack() { - contentStack = UIStackView(arrangedSubviews: [numberContainerView, messageLabel]) - contentStack.axis = .horizontal - contentStack.spacing = 16 - contentStack.alignment = .center - contentStack.embedInSuperView(self) - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsPresenter.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsPresenter.swift index a69cbe715..e009d1a9d 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsPresenter.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsPresenter.swift @@ -77,8 +77,6 @@ extension SettingsPresenter: SettingsPresenterProtocol { showLegalOptions() case .websiteAccount: showLoginScreen() - case .inviteFriends: - showInviteFriendsScreen() } } } @@ -105,9 +103,6 @@ private extension SettingsPresenter { snapshot.appendSections([.main(2)]) - if !interactableDomains.isEmpty { - snapshot.appendItems([.inviteFriends]) - } snapshot.appendItems(SettingsViewController.SettingsMenuItem.supplementaryItems) snapshot.appendSections([.main(3)]) @@ -202,21 +197,6 @@ private extension SettingsPresenter { in: view) } } - - func showInviteFriendsScreen() { - guard let nav = view?.cNavigationController else { return } - - let interactableDomains = appContext.walletsDataService.wallets.combinedDomains().interactableItems() - - guard let domainDisplayInfo = interactableDomains.first else { - Debugger.printFailure("Failed to get domain for referral code", critical: true) - return } - - let domain = domainDisplayInfo.toDomainItem() - - UDRouter().showInviteFriendsScreen(domain: domain, - in: nav) - } } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsViewController.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsViewController.swift index e3736cda8..89aa3cc91 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsViewController.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Settings/SettingsViewController.swift @@ -203,7 +203,6 @@ extension SettingsViewController { case rateUs, learn, twitter, support, legal case testnet(isOn: Bool) case websiteAccount(user: FirebaseUser?) - case inviteFriends var title: String { switch self { @@ -227,14 +226,12 @@ extension SettingsViewController { return "Testnet" case .websiteAccount: return String.Constants.viewVaultedDomains.localized() - case .inviteFriends: - return String.Constants.settingsInviteFriends.localized() } } var subtitle: String? { switch self { - case .wallets, .security, .appearance, .rateUs, .learn, .twitter, .support, .legal, .testnet, .inviteFriends: + case .wallets, .security, .appearance, .rateUs, .learn, .twitter, .support, .legal, .testnet: return nil case .websiteAccount: return String.Constants.protectedByUD.localized() @@ -263,8 +260,6 @@ extension SettingsViewController { return UIImage(named: "settingsIconTestnet")! case .websiteAccount: return .domainsProfileIcon - case .inviteFriends: - return .giftBoxIcon20 } } @@ -282,7 +277,7 @@ extension SettingsViewController { return .brandUnstoppablePink case .testnet: return .brandSkyBlue - case .rateUs, .learn, .twitter, .support, .legal, .inviteFriends: + case .rateUs, .learn, .twitter, .support, .legal: return .backgroundMuted2 case .websiteAccount: return .brandDeepBlue @@ -300,7 +295,7 @@ extension SettingsViewController { return .chevron(value: user.email ?? "Twitter") } return .chevron(value: nil) - case .rateUs, .learn, .twitter, .support, .legal, .inviteFriends: + case .rateUs, .learn, .twitter, .support, .legal: return .empty case .testnet(let isOn): return .switcher(isOn: isOn) @@ -342,8 +337,6 @@ extension SettingsViewController { return .settingsTestnet case .websiteAccount: return .settingsWebsiteAccount - case .inviteFriends: - return .settingsInviteFriends } } } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift b/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift index 6574783c3..5b50d012c 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift @@ -210,7 +210,6 @@ extension Analytics { case loginWithWebsiteAccount, loginWithEmailAndPassword case parkedDomainsList, noParkedDomainsFound, loadingParkedDomains case transferEnterRecipient, transferReviewAndConfirm - case inviteFriends case chatsHome, chatRequestsList, chatChannelsSpamList case chatDialog, channelFeed case publicDomainProfile @@ -286,7 +285,7 @@ extension Analytics { case editProfile, manageDomain, shareLink, saveAsImage, createNFCTag // Settings - case settingsWallets, settingsSecurity, settingsTheme, settingsLearn, settingsTwitter, settingsSupport, settingsLegal, settingsTestnet, settingsHomeScreen, settingsRateUs, settingsWebsiteAccount, settingsInviteFriends + case settingsWallets, settingsSecurity, settingsTheme, settingsLearn, settingsTwitter, settingsSupport, settingsLegal, settingsTestnet, settingsHomeScreen, settingsRateUs, settingsWebsiteAccount // Security settings case securitySettingsPasscode, securitySettingsBiometric, securitySettingsRequireSAWhenOpen diff --git a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift index 0c9c49743..7642790b5 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift @@ -11,7 +11,6 @@ struct SerializedPublicDomainProfile: Decodable { let profile: PublicDomainProfileAttributes let metadata: PublicDomainProfileMetaData let socialAccounts: SocialAccounts? - let referralCode: String? let social: DomainProfileSocialInfo? let records: [String : String]? let walletBalances: [ProfileWalletBalance]? @@ -606,7 +605,7 @@ struct ProfileUpdateRequest: Encodable, Hashable { } enum GetDomainProfileField: String { - case profile, socialAccounts, messaging, cryptoVerifications, records, humanityCheck, referralCode + case profile, socialAccounts, messaging, cryptoVerifications, records, humanityCheck } struct SocialAccount: Hashable, Encodable { diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift index 4de6f7d5f..f565f0bef 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift @@ -91,7 +91,6 @@ extension MockUDDomainsService: UDDomainsServiceProtocol { to wallet: UDWallet, userEmail: String, securityCode: String) async throws { } - func getReferralCodeFor(domain: DomainItem) async throws -> String? { nil } func resolveDomainOwnerFor(domainName: DomainName) async -> HexAddress? { nil } } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift index 297fa3d26..bcbbe584a 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift @@ -100,12 +100,6 @@ extension UDDomainsService: UDDomainsServiceProtocol { securityCode: securityCode) } - func getReferralCodeFor(domain: DomainItem) async throws -> String? { - let profile = try await NetworkService().fetchPublicProfile(for: domain, - fields: [.referralCode]) - return profile.referralCode - } - // Resolution func resolveDomainOwnerFor(domainName: DomainName) async -> HexAddress? { return(try? await NetworkService().fetchGlobalReverseResolution(for: domainName))?.address diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsServiceProtocol.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsServiceProtocol.swift index 0a42eb381..d67fafdf4 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsServiceProtocol.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsServiceProtocol.swift @@ -24,7 +24,6 @@ protocol UDDomainsServiceProtocol { func findDomains(by domainNames: [String]) -> [DomainItem] func getAllDomains() -> [DomainItem] - func getReferralCodeFor(domain: DomainItem) async throws -> String? // Resolution func resolveDomainOwnerFor(domainName: DomainName) async -> HexAddress? diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDRouter.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDRouter.swift index 492d74943..1be547587 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDRouter.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDRouter.swift @@ -557,13 +557,6 @@ class UDRouter: DomainProfileSignatureValidator { return vc } - func showInviteFriendsScreen(domain: DomainItem, - in nav: CNavigationController) { - let vc = buildInviteFriendsModule(domain: domain) - - nav.pushViewController(vc, animated: true) - } - // func showChatsListScreen(in nav: CNavigationController, // presentOptions: ChatsList.PresentOptions) { // let vc = buildChatsListModule(presentOptions: presentOptions) @@ -944,14 +937,6 @@ private extension UDRouter { return vc } - func buildInviteFriendsModule(domain: DomainItem) -> UIViewController { - let vc = InviteFriendsViewController.nibInstance() - let presenter = InviteFriendsViewPresenter(view: vc, - domain: domain) - vc.presenter = presenter - return vc - } - // func buildChatRequestsModuleWith(dataType: ChatsRequestsListViewPresenter.DataType, // profile: MessagingChatUserProfileDisplayInfo) -> UIViewController { // let vc = ChatsListViewController.nibInstance() diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings index 0c7e3fe31..d46ae2bb0 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings @@ -329,7 +329,6 @@ "SETTINGS_FOLLOW_TWITTER" = "Follow us on Twitter"; "SETTINGS_SUPPORT_N_FEEDBACK" = "Support & feedback"; "SETTINGS_LEGAL" = "Legal"; -"SETTINGS_INVITE_FRIENDS" = "Invite friends"; "SETTINGS_SECURITY_PASSCODE" = "Passcode"; "SETTINGS_SECURITY_CHANGE_PASSCODE" = "Change passcode"; @@ -800,13 +799,6 @@ "CLEAR_RECORDS_UPON_TRANSFER" = "Clear records upon transfer"; "OPTIONAL" = "Optional"; "TRANSFER_IN_PROGRESS" = "Transfer in progress"; - -// Referral -"INVITE_FRIENDS_TITLE" = "Give $10, get $10"; -"INVITE_FRIENDS_SUBTITLE" = "Get $10 in credits when someone makes a $40+ purchase domain using your referral link."; -"INVITE_FRIENDS_STEP_1_MESSAGE" = "Share your invite link with a friend"; -"INVITE_FRIENDS_STEP_2_MESSAGE" = "Your friend makes a first purchase of $40 or more"; -"INVITE_FRIENDS_STEP_3_MESSAGE" = "You receive $10 credit as a thank you for the referral"; "COPY_LINK" = "Copy link"; // Apple Pay required diff --git a/unstoppable-ios-app/domains-manager-iosTests/Helpers/TestableUDDomainsService.swift b/unstoppable-ios-app/domains-manager-iosTests/Helpers/TestableUDDomainsService.swift index f95d6d346..174a59075 100644 --- a/unstoppable-ios-app/domains-manager-iosTests/Helpers/TestableUDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-iosTests/Helpers/TestableUDDomainsService.swift @@ -52,10 +52,6 @@ final class TestableUDDomainsService: UDDomainsServiceProtocol { [] } - func getReferralCodeFor(domain: DomainItem) async throws -> String? { - nil - } - func resolveDomainOwnerFor(domainName: DomainName) async -> HexAddress? { nil }