Skip to content

Commit

Permalink
Curate explorer listings
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Nov 29, 2023
1 parent c59c907 commit 6b6119a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ struct Listing: Codable {
let homepage: String?
let image_url: ImageURL?
let dapp_url: String
let order: Int?
let is_verified: Bool
let is_featured: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum ListingsAPI: HTTPService {
}

var queryParameters: [String : String]? {
return ["projectId": InputConfig.projectId, "entries": "100", "is_verified": "false"]
return ["projectId": InputConfig.projectId, "entries": "100"]
}

var additionalHeaderFields: [String : String]? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ struct ListingViewModel: Identifiable {
let url = listing.dapp_url
return URL(string: url)?.host
}

var order: Int {
return listing.order ?? 10000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ final class NotificationsPresenter: ObservableObject {
var listingViewModels: [ListingViewModel] {
return listings
.map { ListingViewModel(listing: $0) }
.sorted(by:
.sorted(by:
{ subscription(forListing: $0) != nil && subscription(forListing: $1) == nil },
{ $0.order < $1.order },
{ $0.title < $1.title }
)
}
Expand Down

0 comments on commit 6b6119a

Please sign in to comment.