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-1836 - Explore feature #433

Merged
merged 19 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2c74fa6
MOB-1837 - Added explore tab UI (#412)
Oleg-Pecheneg Mar 5, 2024
a303567
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 5, 2024
47b2927
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 5, 2024
3cdfb97
MOB-1856 - Show tokens in public profile (#415)
Oleg-Pecheneg Mar 6, 2024
2c1bac3
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 6, 2024
c33bd13
MOB-1857 - Remove old search entry (#418)
Oleg-Pecheneg Mar 6, 2024
20b0b21
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 6, 2024
636988e
MOB-1858 - Load followers on explore feature (#420)
Oleg-Pecheneg Mar 6, 2024
cc87900
MOB-1866 - Track search domains history (#421)
Oleg-Pecheneg Mar 6, 2024
950425d
MOB-1867 - Added empty states to Explore (#422)
Oleg-Pecheneg Mar 6, 2024
89d2dad
MOB-1869 - Added section with suggested profiles (#423)
Oleg-Pecheneg Mar 7, 2024
82db1f3
MOB-1870 - Remove viewing profile selection on public domain profile …
Oleg-Pecheneg Mar 9, 2024
9b7e898
MOB-1872 - Update buttons according to new style guide (#425)
Oleg-Pecheneg Mar 11, 2024
08f83cc
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 11, 2024
62b0c57
MOB-1869 - Suggested profiles updates (reason structure and filter by…
Oleg-Pecheneg Mar 12, 2024
8b6e4a5
Merge branch 'development' into dev/feat/MOB-1836-explore
Oleg-Pecheneg Mar 12, 2024
a1380ea
MOB-1873 - Show trending domains section (#430)
Oleg-Pecheneg Mar 12, 2024
1243213
MOB-1875 - Fixed issue when User was not asked to create wallet befor…
Oleg-Pecheneg Mar 12, 2024
2420677
Public profile view optimisations (#432)
Oleg-Pecheneg Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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