Skip to content

Commit

Permalink
MOB-1836 - Explore feature (#433)
Browse files Browse the repository at this point in the history
* MOB-1837 - Added explore tab UI (#412)

* Created HomeExploreView

* Increased tappable area of chat nav title profile selector

* Created explore view model.
Extended mock fabric

* Added explore view to tab bar

* Prepare mock data

* Implemented UI for followers section

* Added expandable followers/followings sections

* Added separators

* Moved search functionality to explore section

* Set explore title visibility

* Created UDSegmentedControlView
Created Name space for HomeExplore
Reuse segmented control view on chats list

* Updated segmented control UI
Refactoring

* Added section with trending profiles

* Fixed preview target

* Implemented UI for followers picker

* Refactoring.
Prepare to display recent in search result

* View refactoring

* Implemented recent section header view

* Working on user domains search result

* Updated imge bridge view
Created LineView
Created UI for user domains sections

* Handle domain selection

* Added empty state to search result.
Added UI for global search result

* Use adjusted key to search for user's domains
Finalise UI of explore section

* MOB-1856 - Show tokens in public profile (#415)

* Created HomeExploreView

* Increased tappable area of chat nav title profile selector

* Created explore view model.
Extended mock fabric

* Added explore view to tab bar

* Prepare mock data

* Implemented UI for followers section

* Added expandable followers/followings sections

* Added separators

* Moved search functionality to explore section

* Set explore title visibility

* Created UDSegmentedControlView
Created Name space for HomeExplore
Reuse segmented control view on chats list

* Updated segmented control UI
Refactoring

* Added section with trending profiles

* Fixed preview target

* Implemented UI for followers picker

* Refactoring.
Prepare to display recent in search result

* View refactoring

* Implemented recent section header view

* Working on user domains search result

* Updated imge bridge view
Created LineView
Created UI for user domains sections

* Handle domain selection

* Added empty state to search result.
Added UI for global search result

* Use adjusted key to search for user's domains
Finalise UI of explore section

* Public domain view refactoring

* Rename crypto to addresses

* Extraced token ui description from home module

* Show list of tokens on public profile

* MOB-1857 - Remove old search entry (#418)

* Created HomeExploreView

* Increased tappable area of chat nav title profile selector

* Created explore view model.
Extended mock fabric

* Added explore view to tab bar

* Prepare mock data

* Implemented UI for followers section

* Added expandable followers/followings sections

* Added separators

* Moved search functionality to explore section

* Set explore title visibility

* Created UDSegmentedControlView
Created Name space for HomeExplore
Reuse segmented control view on chats list

* Updated segmented control UI
Refactoring

* Added section with trending profiles

* Fixed preview target

* Implemented UI for followers picker

* Refactoring.
Prepare to display recent in search result

* View refactoring

* Implemented recent section header view

* Working on user domains search result

* Updated imge bridge view
Created LineView
Created UI for user domains sections

* Handle domain selection

* Added empty state to search result.
Added UI for global search result

* Use adjusted key to search for user's domains
Finalise UI of explore section

* Public domain view refactoring

* Rename crypto to addresses

* Extraced token ui description from home module

* Show list of tokens on public profile

* MOB-1857 - Removed old search domains entry

* Updated UDCollectionListRowButton usage

* MOB-1858 - Load followers on explore feature (#420)

* Created HomeExploreView

* Increased tappable area of chat nav title profile selector

* Created explore view model.
Extended mock fabric

* Added explore view to tab bar

* Prepare mock data

* Implemented UI for followers section

* Added expandable followers/followings sections

* Added separators

* Moved search functionality to explore section

* Set explore title visibility

* Created UDSegmentedControlView
Created Name space for HomeExplore
Reuse segmented control view on chats list

* Updated segmented control UI
Refactoring

* Added section with trending profiles

* Fixed preview target

* Implemented UI for followers picker

* Refactoring.
Prepare to display recent in search result

* View refactoring

* Implemented recent section header view

* Working on user domains search result

* Updated imge bridge view
Created LineView
Created UI for user domains sections

* Handle domain selection

* Added empty state to search result.
Added UI for global search result

* Use adjusted key to search for user's domains
Finalise UI of explore section

* Public domain view refactoring

* Rename crypto to addresses

* Extraced token ui description from home module

* Show list of tokens on public profile

* MOB-1857 - Removed old search domains entry

* Updated UDCollectionListRowButton usage

* Created entities and service for public profile

* Created core data storage for public domain profiles

* Adjust UI on explore screen

* Extended public profile

* Use public domain profile instead of serialized model.
Load domain profile through service

* Isolate domain profile service dependencies

* Moved follow/unfollow functions to profile service

* Refactoring

* Load and publish socials info

* Updated followers fetching and display

* Refactoring

* Added DomainProfileSocialRelationshipDetails tests

* Adding DomainProfilesServiceTests

* Handle profile selection

* Load user's profile
Handle followers updated in tile.
Fixed preview target

* Fixed long names in follower tile

* Improved concurrency safety of load followers info

* Refactoring

* Track profile state when user follow/unfollow/update profile

* Fixed loading of profile info in follower tile.
Fixed follow/unfollow actions in public profile

* Test follow and unfollow functions

* Call load more followers on scroll

* Extended tests to initial data loaded

* Added testLoadMoreCalledOnPublishedRequestOnce

* MOB-1866 - Track search domains history (#421)

* Created HomeExploreView

* Increased tappable area of chat nav title profile selector

* Created explore view model.
Extended mock fabric

* Added explore view to tab bar

* Prepare mock data

* Implemented UI for followers section

* Added expandable followers/followings sections

* Added separators

* Moved search functionality to explore section

* Set explore title visibility

* Created UDSegmentedControlView
Created Name space for HomeExplore
Reuse segmented control view on chats list

* Updated segmented control UI
Refactoring

* Added section with trending profiles

* Fixed preview target

* Implemented UI for followers picker

* Refactoring.
Prepare to display recent in search result

* View refactoring

* Implemented recent section header view

* Working on user domains search result

* Updated imge bridge view
Created LineView
Created UI for user domains sections

* Handle domain selection

* Added empty state to search result.
Added UI for global search result

* Use adjusted key to search for user's domains
Finalise UI of explore section

* Public domain view refactoring

* Rename crypto to addresses

* Extraced token ui description from home module

* Show list of tokens on public profile

* MOB-1857 - Removed old search domains entry

* Updated UDCollectionListRowButton usage

* Created entities and service for public profile

* Created core data storage for public domain profiles

* Adjust UI on explore screen

* Extended public profile

* Use public domain profile instead of serialized model.
Load domain profile through service

* Isolate domain profile service dependencies

* Moved follow/unfollow functions to profile service

* Refactoring

* Load and publish socials info

* Updated followers fetching and display

* Refactoring

* Added DomainProfileSocialRelationshipDetails tests

* Adding DomainProfilesServiceTests

* Handle profile selection

* Load user's profile
Handle followers updated in tile.
Fixed preview target

* Fixed long names in follower tile

* Improved concurrency safety of load followers info

* Refactoring

* Track profile state when user follow/unfollow/update profile

* Fixed loading of profile info in follower tile.
Fixed follow/unfollow actions in public profile

* Test follow and unfollow functions

* Call load more followers on scroll

* Extended tests to initial data loaded

* Added testLoadMoreCalledOnPublishedRequestOnce

* Created storage for recent search profiles.

* Fixed preview target

* Test recent profiles in view model

* Extended view model recent search tests

* Test profile display info in home explore view model

* Added empty state when no recent search results.

* MOB-1867 - Added empty states to Explore (#422)

* Fixed preview app context setup

* Implemented UI for empty states

* Hide search when no profile

* Handle empty state actions

* Make navigation smoother

* MOB-1869 - Added section with suggested profiles (#423)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* MOB-1870 - Remove viewing profile selection on public domain profile screen (#424)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* MOB-1872 - Update buttons according to new style guide (#425)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* Updated buttons background

* Finalised buttons UI update

* Updated button style on public profile view

* MOB-1869 - Suggested profiles updates (reason structure and filter by not following)  (#427)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* Updated buttons background

* Finalised buttons UI update

* Updated button style on public profile view

* Updated profile suggestions serialized entity

* Filter profile suggestions by not following

* Show toast when followed

* MOB-1873 - Show trending domains section (#430)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* Updated buttons background

* Finalised buttons UI update

* Updated button style on public profile view

* Updated profile suggestions serialized entity

* Filter profile suggestions by not following

* Show toast when followed

* Updated UI for trending domains

* Load and display trending domains

* Enable animation in explore view

* MOB-1875 - Fixed issue when User was not asked to create wallet before checkout (#431)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* Updated buttons background

* Finalised buttons UI update

* Updated button style on public profile view

* Updated profile suggestions serialized entity

* Filter profile suggestions by not following

* Show toast when followed

* Updated UI for trending domains

* Load and display trending domains

* Enable animation in explore view

* Prepare testable services

* Fixed tests target.
Added wallets data service tests

* Fixed issue when selected wallet wasn't updated in wallets service when

* Improved profile selection logic during checkout

* Activate search domains keyboard on appear

* Public profile view optimisations (#432)

* Refactoring

* Created scroll content for suggested profiles

* Implemented UI for suggested profiles

* Refactoring

* Added section header

* Added page control

* Refactoring
Added related actions

* Adjusted UI

* Added following state to suggestion structure

* Created suggested prfoiles list view

* Fixed nav bar and tab bar on explore screen when navigate

* Created serialized profile suggestion
Added API to get profile suggestions.
Added tests

* Fixed cover image storing in follower tile view

* Load more suggestions if available

* UX improvements

* Refactoring

* Added follow actions publisher tp domain profiles service.
Added tests

* Fixed tests

* Refactoring

* Updated follow actions publisher

* Update following state in suggested profiles array

* Test suggested profiles loaded and status updated on action

* testSuggestedProfileFollowStatusUpdatedFromProfilesService

* Public profile viewing domain refactoring

* Cleaning

* Updating public profile ui

* Updated UI of public profile view

* Added title view to public domain profile

* Minor UI updates

* Updated buttons background

* Finalised buttons UI update

* Updated button style on public profile view

* Updated profile suggestions serialized entity

* Filter profile suggestions by not following

* Show toast when followed

* Updated UI for trending domains

* Load and display trending domains

* Enable animation in explore view

* Prepare testable services

* Fixed tests target.
Added wallets data service tests

* Fixed issue when selected wallet wasn't updated in wallets service when

* Improved profile selection logic during checkout

* Activate search domains keyboard on appear

* Public profile badge optimisation

* Updated apple pay button style

* Added bottom padding to public profile view
  • Loading branch information
Oleg-Pecheneg authored Mar 12, 2024
1 parent 61741d7 commit 8cc6105
Show file tree
Hide file tree
Showing 192 changed files with 7,908 additions and 2,289 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 8cc6105

Please sign in to comment.