Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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 @@ -24,31 +24,11 @@ class ViewController: UIViewController {
}

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"))

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)
}

}

48 changes: 30 additions & 18 deletions unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ extension String {
static let getDomainCardSubtitle = "GET_DOMAIN_CARD_SUBTITLE"
static let findANewDomain = "FIND_A_NEW_DOMAIN"
static let findYourDomain = "FIND_YOUR_DOMAIN"
static let searchForANewDomain = "SEARCH_FOR_A_NEW_DOMAIN"
static let searchForADomain = "SEARCH_FOR_A_DOMAIN"
static let trending = "TRENDING"
static let noAvailableDomains = "NO_AVAILABLE_DOMAINS"
static let tryEnterDifferentName = "TRY_ENTER_DIFF_NAME"
Expand Down Expand Up @@ -1080,6 +1080,15 @@ extension String {
static let purchaseSearchCantButPullUpTitle = "PURCHASE_SEARCH_CANT_BUY_PULL_UP_TITLE"
static let purchaseSearchCantButPullUpSubtitle = "PURCHASE_SEARCH_CANT_BUY_PULL_UP_SUBTITLE"
static let payWithCredits = "PAY_WITH_CREDITS"
static let buyDomainsSearchTitle = "BUY_DOMAINS_SEARCH_TITLE"
static let buyDomainsCartEmptyTitle = "BUY_DOMAINS_CART_EMPTY_TITLE"
static let buyDomainsCartEmptySubtitle = "BUY_DOMAINS_CART_EMPTY_SUBTITLE"
static let buyDomainsCartTitle = "BUY_DOMAINS_CART_TITLE"
static let searchDomains = "SEARCH_DOMAINS"
static let clear = "CLEAR"
static let startTyping = "START_TYPING"
static let buyDomainsSearchResultShowMoreTitle = "BUY_DOMAINS_SEARCH_RESULT_SHOW_MORE_TITLE"
static let buyDomainsSearchResultShowLessTitle = "BUY_DOMAINS_SEARCH_RESULT_SHOW_LESS_TITLE"

// Home
static let homeWalletTokensComeTitle = "HOME_WALLET_TOKENS_COME_TITLE"
Expand All @@ -1091,7 +1100,6 @@ extension String {
static let selectPrimaryDomainTitle = "SELECT_PRIMARY_DOMAIN_TITLE"
static let selectPrimaryDomainSubtitle = "SELECT_PRIMARY_DOMAIN_SUBTITLE"


static let saveToPhotos = "SAVE_TO_PHOTOS"
static let refreshMetadata = "REFRESH_METADATA"
static let viewOnMarketPlace = "VIEW_ON_MARKETPLACE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,31 +760,6 @@ struct DomainProfileViewControllerWrapper: UIViewControllerRepresentable {

}

struct PurchaseDomainProfileViewControllerWrapper: UIViewControllerRepresentable {

let domain: DomainToPurchase
weak var viewModel: PurchaseDomainsViewModel?

func makeUIViewController(context: Context) -> UIViewController {

let vc = DomainProfileViewController.nibInstance()
let presenter = PurchaseDomainDomainProfileViewPresenter(view: vc,
domain: domain)
presenter.viewModel = viewModel
vc.presenter = presenter
return vc
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) { }

final class ProfileNavController: UINavigationController {
override var traitCollection: UITraitCollection {
UITraitCollection(traitsFrom: [super.traitCollection, UITraitCollection(userInterfaceStyle: .dark)])
}
}

}

#Preview {

struct PreviewContainer: View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private extension PublicProfileView {
AvatarShapeClipper(style: avatarStyle,
avatarSize: avatarSize)
})
.sideInsets(-sidePadding)
.padding(.horizontal, -sidePadding)

avatarWithActionsView()

Expand All @@ -222,7 +222,7 @@ private extension PublicProfileView {
.offset(y: -26)
Spacer()
}
.sideInsets(sidePadding)
.padding(.horizontal, sidePadding)
.frame(width: UIScreen.main.bounds.width)
.padding(EdgeInsets(top: 0, leading: 0, bottom: 100, trailing: 0))
}
Expand Down Expand Up @@ -463,9 +463,9 @@ private extension PublicProfileView {
carouselSocialAccountsItemIfAvailable(in: profile)
carouselCryptoRecordsItemIfAvailable(in: profile)
}
.sideInsets(sidePadding)
.padding(.horizontal, sidePadding)
}
.sideInsets(-sidePadding)
.padding(.horizontal, -sidePadding)
}

@ViewBuilder
Expand Down Expand Up @@ -508,7 +508,7 @@ private extension PublicProfileView {
.fill(Color.white)
.opacity(0.16)
content()
.sideInsets(12)
.padding(.horizontal, 12)
}
.frame(height: 32)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private extension HomeWalletDomainCellView {
.shadow(color: .black.opacity(0.32), radius: 8.99346, x: 0, y: 6.29542)
Spacer()
}
.sideInsets(8)
.padding(.horizontal, 8)
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct HotFeatureSuggestionDetailsView: View, ViewAnalyticsLogger {
NavigationView {
OffsetObservingScrollView(offset: $scrollOffset) {
contentView()
.sideInsets(16)
.padding(.horizontal, 16)
UDButtonView(text: String.Constants.gotIt.localized(),
style: .large(.raisedTertiary)) {
logButtonPressedAnalyticEvents(button: .gotIt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ struct PurchaseDomainsCheckoutView: View, ViewAnalyticsLogger {
Color.clear
}
}
.purchaseDomainsTitleViewModifier()
.pullUpError($error)
.modifier(ShowingSelectDiscounts(isSelectDiscountsPresented: $isSelectDiscountsPresented))
.viewPullUp($pullUp)
Expand Down Expand Up @@ -686,6 +685,7 @@ private extension PullUpErrorConfiguration {
PurchaseDomainsCheckoutView(domain: .init(name: "oleg.x",
price: 10000,
metadata: nil,
isTaken: false,
isAbleToPurchase: true),
selectedWallet: MockEntitiesFabric.Wallet.mockEntities()[0],
wallets: Array(MockEntitiesFabric.Wallet.mockEntities().prefix(4)),
Expand Down
Loading