Skip to content

Commit

Permalink
MOB-2139 - Buy multiple domains (#647)
Browse files Browse the repository at this point in the history
* MOB-2140 - Let user to select multiple domains to buy on the search screen (#623)

* Fixed preview target

* Added local cart to search view.
Pass array of domains as result

* Recreate purchase flow using SwiftUI

* Updated passing of environment variables.
Updated purchase flow navigation

* Tab router to purchase navigation refactoring
Adding progress view

* Created DashedProgressView

* Improved run purchase flow delay

* Fixed navigation tracker view modifier

* Improved progress tracker appearance and animation

* Fixed nav bar on checkout view

* Removed UIKit files

* Fixed nav title view behaviour

* Fixed UI for last step

* Fixed preview target

* Refactoring

* Cleaning

* Improved navigation handling

* MOB-2146 - Implement new UI to search domains to purchase (#625)

* Updated search view layout

* Cleaning

* Added cart button

* Refactoring
Added empty state
Added opening of cart view

* Implemented new UI for search result row

* Implemented UI for cart content

* Refactoring

* Created checkpout button

* Fixed debug target

* Localized content
Removed progress bar fromt he nav bar

* Added missing localization

* Removed fill domain profile step

* Extend DomainToPurchase with isTaken property

* Implemented show/hide exact match separation

* MOB-2151 - Implement new checkout view UI to purchase multiple domains (#626)

* Updated search view layout

* Cleaning

* Added cart button

* Refactoring
Added empty state
Added opening of cart view

* Implemented new UI for search result row

* Implemented UI for cart content

* Refactoring

* Created checkpout button

* Fixed debug target

* Localized content
Removed progress bar fromt he nav bar

* Added missing localization

* Removed fill domain profile step

* Extend DomainToPurchase with isTaken property

* Implemented show/hide exact match separation

* Updated mint to section

* Pass multiple domains to checkout view

* Implemented UI for domains list on checkout

* Added subtotal to checkout section

* UI updates

* Localized content

* Updated minting section UI

* Implemented UI to select purchase location

* Removed usage of credits in Ecomm requests

* Implemented new UI for discounts section

* Created order summary view with ability to remove domains

* Implemented toast view when user remove domain from the list

* Updated dispalying of discounts

* Handle user removed all domains from the cart on the checkout

* Respect purchase country selection

* Handle max price available to purchase

* UI adjustments

* MOB-2152 - Implemented tracking of recent search history (#627)

* MOB-2153 - Purchase domains Search filters (#628)

* MOB-2152 - Implemented tracking of recent search history

* Created filters view

* Prepare to show filters view

* Added filtre button.
Fixed initial filters applied.

* MOB-2154 - Load and display purchase domains suggestions (#629)

* MOB-2155 - All done after domains purchased (#630)

* Added confetti modifier

* Implemented UI of purchase completed view

* Pass purchased data to final view and handle actions

* Finalise UI

* MOB-2156 - Show minting domains in progress on the home view (#631)

* Added confetti modifier

* Implemented UI of purchase completed view

* Pass purchased data to final view and handle actions

* Finalise UI

* Implemented minting in progress section on the home view

* Created minting domains list

* MOB-2157 Preselect minting wallet from web (#632)

* Added confetti modifier

* Implemented UI of purchase completed view

* Pass purchased data to final view and handle actions

* Finalise UI

* Implemented minting in progress section on the home view

* Created minting domains list

* MOB-2157 - Pre-select minting wallet from the web settings if possible

* MOB-2158 - Check if user is in the US (#633)

* MOB-2159 - Updated analytics in new purchase flow (#634)

* Added confetti modifier

* Implemented UI of purchase completed view

* Pass purchased data to final view and handle actions

* Finalise UI

* Implemented minting in progress section on the home view

* Created minting domains list

* MOB-2157 - Pre-select minting wallet from the web settings if possible

* MOB-2158 - Check if user is in the US

* MOB-2159 - Updated analytics in new purchase flow

* MOB-2164 - Update search domains filters (#636)

* Apply list of dns domains TLDs from the web app

* Fixed load suggestions logic

* MOB-2146 - Hide unavailable domains section (#642)

* MOB-2155 - Fixed issue when credits were not applied (#643)

* MOB-2152 - Improved recent result selection (#645)

* MOB-2152 - Improved recent result selection

* Fixed preview target

* Fixed unnecessary refresh cart calls

* Filter suggestions for UD domains

* Fixed search results is empty verification

* Search for ENS and DNS domains (#648)
  • Loading branch information
Oleg-Pecheneg authored Aug 19, 2024
1 parent b756b55 commit 14247a9
Show file tree
Hide file tree
Showing 126 changed files with 4,371 additions and 1,913 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ final class AppContext: AppContextProtocol {
var domainProfilesService: DomainProfilesServiceProtocol
var walletTransactionsService: WalletTransactionsServiceProtocol
var mpcWalletsService: MPCWalletsServiceProtocol

var ipVerificationService: IPVerificationServiceProtocol = IPVerificationService()

func createStripeInstance(amount: Int, using secret: String) -> StripeServiceProtocol {
StripeService(paymentDetails: .init(amount: amount, paymentSecret: secret))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class GIFAnimationsService {
static let shared = GIFAnimationsService()

func createGIFImageWithData(_ data: Data,
id: String,
maxImageSize: CGFloat,
maskingType: GIFMaskingType? = nil) async -> UIImage? {
UIImage(data: data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ final class ImageLoadingService: ImageLoadingServiceProtocol {
return UIImage.Preview.previewLandscape
let imageData = try Data(contentsOf: url)

if let gif = await GIFAnimationsService.shared.createGIFImageWithData(imageData) {
if let gif = await GIFAnimationsService.shared.createGIFImageWithData(imageData,
id: UUID().uuidString,
maxImageSize: maxImageSize ?? Constants.downloadedImageMaxSize) {
return gif
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// PreviewIPVerificationService.swift
// domains-manager-ios
//
// Created by Oleg Kuplin on 13.08.2024.
//

import Foundation

final class IPVerificationService: IPVerificationServiceProtocol {
func isUserInTheUS() async throws -> Bool {
false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@ struct Storage {

class SpecificStorage<T: Codable> {
let fileName: String
private var data: T? = nil
private let queue = DispatchQueue(label: "preview.serial.storage")

init(fileName: String) {
self.fileName = fileName
}

func retrieve() -> T? {
nil
queue.sync { data }
}

@discardableResult
func store(_ data: T) -> Bool {

return true
queue.sync {
self.data = data
return true
}
}

func remove() {

queue.sync {
self.data = nil
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import SwiftUI

@available(iOS 17, *)
#Preview {
let domain = DomainToPurchase(name: "oleg.x", price: 10000, metadata: nil, isAbleToPurchase: true)
let vc = DomainProfileViewController.nibInstance()
let presenter = PurchaseDomainDomainProfileViewPresenter(view: vc,
domain: domain)
vc.presenter = presenter
let nav = EmptyRootCNavigationController(rootViewController: vc)

return nav
EmptyView()
// let domain = DomainToPurchase(name: "oleg.x", price: 10000, metadata: nil, isAbleToPurchase: true)
// let vc = DomainProfileViewController.nibInstance()
// let presenter = PurchaseDomainDomainProfileViewPresenter(view: vc,
// domain: domain)
// vc.presenter = presenter
// let nav = EmptyRootCNavigationController(rootViewController: vc)
//
// return nav
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,15 @@ class ViewController: UIViewController {
}

@IBAction func runPurchaseButtonPressed() {
UDRouter().showSearchDomainToPurchase(in: self) { result in

}

}

func showPurchaseDomainsSearch() {
let view = PurchaseSearchDomainsView(domainSelectedCallback: { _ in })
let view = PurchaseDomainsSearchView()

let vc = UIHostingController(rootView: view)
addChildViewController(vc, andEmbedToView: self.view)
}

func showPurchaseDomainsCheckout() {
let view = PurchaseDomainsCheckoutView(domain: .init(name: "oleg.x", price: 10000, metadata: nil, isAbleToPurchase: true),
selectedWallet: MockEntitiesFabric.Wallet.mockEntities()[0],
wallets: MockEntitiesFabric.Wallet.mockEntities(),
profileChanges: .init(domainName: "oleg.x"),
delegate: nil)

let vc = UIHostingController(rootView: view)
addChildViewController(vc, andEmbedToView: self.view)
}

func showDomainProfile() {
let domain = DomainToPurchase(name: "oleg.x", price: 10000, metadata: nil, isAbleToPurchase: true)
let vc = DomainProfileViewController.nibInstance()
let presenter = PurchaseDomainDomainProfileViewPresenter(view: vc,
domain: domain)
vc.presenter = presenter
let nav = EmptyRootCNavigationController(rootViewController: vc)
present(nav, animated: false)
}

}

Loading

0 comments on commit 14247a9

Please sign in to comment.