Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
* development:
  Adjusted buy crypto pull up
  MOB-1889 - Buy crypto (#443)
  MOB-1887 - Start pull data timer if wallet has minting domains (#442)
  MOB-1882 - Show ENS domain profile if no UD available (#440)
  MOB-1856 - Fixed token logos inconsistency and added tokens sorting on public profile (#439)
  MOB-1884 Update WC wallet registry (#441)
  MOB-1866 - Updated explore search bar prompt (#438)
  MOB-1869 - Fixed number of followers after user follow/unfollow (#437)
  Updated button title when vaulted domains discovered (#434)
  MOB-1881 - Track SOL and BTC balances if added in profile (#436)
  MOB-1880 - Use OKLink to view wallets and transactions (#435)
  MOB-1836 - Explore feature (#433)
  MOB-1773 - Fixed blocking of users in chat (#429)
  Use acquired date for sorting collectibles as most recent (#428)
  MOB-1871 - Fixed issue when user couldn't login with website account during onboarding. (#426)
  MOB-1868 Check former dependencies on Zesame (ZIL) (#419)
  fixed dependency on the removed Zesame lib in Tests
  • Loading branch information
rommex committed Mar 15, 2024
2 parents ea6a628 + 42cc262 commit 1a4f62e
Show file tree
Hide file tree
Showing 213 changed files with 8,681 additions and 2,394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import Foundation
let previewContext = AppContext()

final class AppContext: AppContextProtocol {
lazy var userProfileService: UserProfileServiceProtocol = UserProfileService(firebaseParkedDomainsAuthenticationService: firebaseParkedDomainsAuthenticationService,
firebaseParkedDomainsService: firebaseParkedDomainsService,
walletsDataService: walletsDataService)
var userProfileService: UserProfileServiceProtocol

var notificationsService: NotificationsServiceProtocol = NotificationsService()

Expand Down Expand Up @@ -76,9 +74,18 @@ final class AppContext: AppContextProtocol {
var persistedProfileSignaturesStorage: PersistedSignaturesStorageProtocol = PersistedSignaturesStorage()
var hotFeatureSuggestionsService: HotFeatureSuggestionsServiceProtocol = HotFeatureSuggestionsService(fetcher: PreviewHotFeaturesSuggestionsFetcher())
var walletsDataService: WalletsDataServiceProtocol = PreviewWalletsDataService()
var domainProfilesService: DomainProfilesServiceProtocol

func createStripeInstance(amount: Int, using secret: String) -> StripeServiceProtocol {
StripeService(paymentDetails: .init(amount: amount, paymentSecret: secret))
}

init() {
userProfileService = UserProfileService(firebaseParkedDomainsAuthenticationService: firebaseParkedDomainsAuthenticationService,
firebaseParkedDomainsService: firebaseParkedDomainsService,
walletsDataService: walletsDataService)
domainProfilesService = DomainProfilesService(storage: PreviewPublicDomainProfileDisplayInfoStorageService(),
walletsDataService: walletsDataService)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ final class ImageLoadingService: ImageLoadingServiceProtocol {
return UIImage.Preview.previewPortrait
case .initials(let initials, let size, let style):
return await InitialsView(initials: initials, size: size, style: style).toInitialsImage()
case .domainNameInitials(let domainName, let size):
return await loadImage(from: .initials(domainName, size: size, style: .accent),
downsampleDescription: downsampleDescription)
case .domainInitials(let domain, let size):
return await loadImage(from: .initials(domain.name, size: size, style: .accent),
return await loadImage(from: .domainNameInitials(domain.name, size: size),
downsampleDescription: downsampleDescription)
case .domainItemOrInitials(let domain, let size):
if [true, false].randomElement() == true {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// PreviewPublicDomainProfileDisplayInfoStorageService.swift
// unstoppable-preview
//
// Created by Oleg Kuplin on 05.03.2024.
//

import Foundation

final class PreviewPublicDomainProfileDisplayInfoStorageService: DomainProfileDisplayInfoStorageServiceProtocol {
func store(profile: DomainProfileDisplayInfo) {

}

func retrieveProfileFor(domainName: DomainName) throws -> DomainProfileDisplayInfo {
MockEntitiesFabric.PublicDomainProfile.createPublicDomainProfileDisplayInfo(domainName: domainName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ final class PreviewWalletsDataService: WalletsDataServiceProtocol {
func didChangeEnvironment() {

}

func loadBalanceFor(walletAddress: HexAddress) async throws -> [WalletTokenPortfolio] {
MockEntitiesFabric.Wallet.mockEntities()[0].balance
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct DomainItem: DomainEntity {
func doesRequirePayment() -> Bool {
switch self.getBlockchainType() {
case .Ethereum: return true
case .Zilliqa, .Matic: return false
case .Matic: return false
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,8 @@ extension NetworkService {
}

public func fetchPublicProfile(for domainName: DomainName, fields: Set<GetDomainProfileField>) async throws -> SerializedPublicDomainProfile {
.init(profile: .init(displayName: nil,
description: nil,
location: nil,
web2Url: nil,
imagePath: nil,
imageType: nil,
coverPath: nil,
phoneNumber: nil,
domainPurchased: nil),
socialAccounts: nil,
referralCode: nil,
social: nil,
records: nil,
walletBalances: [])
MockEntitiesFabric.DomainProfile.createPublicProfile(domain: domainName,
walletBalance: MockEntitiesFabric.DomainProfile.createPublicProfileWalletBalances())
}

public func refreshDomainBadges(for domain: DomainItem) async throws -> RefreshBadgesResponse {
Expand All @@ -192,7 +180,7 @@ extension NetworkService {
try await fetchBadgesInfo(for: domain.name)
}
public func fetchBadgesInfo(for domainName: DomainName) async throws -> BadgesInfo {
.init(badges: [], refresh: nil)
MockEntitiesFabric.Badges.createBadgesInfo()
}
public func fetchBadgeDetailedInfo(for badge: BadgesInfo.BadgeInfo) async throws -> BadgeDetailedInfo {
.init(badge: .init(code: "", name: "", logo: "", description: ""), usage: .init(rank: 0, holders: 1, domains: 1, featured: []))
Expand Down Expand Up @@ -223,7 +211,7 @@ extension NetworkService {
}
}

extension NetworkService {
extension NetworkService: DomainProfileNetworkServiceProtocol {
public func searchForDomainsWith(name: String,
shouldBeSetAsRR: Bool) async throws -> [SearchDomainProfile] {
var result = [SearchDomainProfile]()
Expand Down Expand Up @@ -256,6 +244,14 @@ extension NetworkService {
func unfollow(_ domainNameToUnfollow: String, by domain: DomainItem) async throws {

}

func getProfileSuggestions(for domainName: DomainName) async throws -> SerializedDomainProfileSuggestionsResponse {
MockEntitiesFabric.ProfileSuggestions.createSerializedSuggestionsForPreview()
}

func getTrendingDomains() async throws -> SerializedRankingDomainsResponse {
MockEntitiesFabric.Explore.createTrendingProfiles()
}
}

extension NetworkService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,25 @@ struct Storage {

}
}

class SpecificStorage<T: Codable> {
let fileName: String

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

func retrieve() -> T? {
nil
}

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

return true
}

func remove() {

}
}
Loading

0 comments on commit 1a4f62e

Please sign in to comment.