Implemented phase 6 for the POC prototype in the Website service.
This commit is contained in:
1 parent
256d22df40
commit
f2f445827b
40 files changed
+1906
-37
No files matched your search
@@ -24,6 +24,9 @@ struct ShopPage {
|
||||
/// The tab, quick filters, and sort order applied.
|
||||
let parameters: SearchParameters
|
||||
|
||||
/// The upcoming events the shop trades at.
|
||||
let pickups: [Event]
|
||||
|
||||
/// The shop shown.
|
||||
let shop: Shop
|
||||
|
||||
@@ -38,6 +41,7 @@ struct ShopPage {
|
||||
/// - inventory: every listing of the shop, counted per format on the tabs.
|
||||
/// - matches: the shop's listings matching the parameters; the screen shows the page they ask for.
|
||||
/// - parameters: the tab, quick filters, and sort order applied.
|
||||
/// - pickups: the upcoming events the shop trades at; none by default.
|
||||
/// - viewer: the signed-in viewer, or `nil` (the default) when signed out.
|
||||
/// - assetVersion: the version token appended to the page's asset URLs, or `nil` (the default) to leave them unversioned.
|
||||
/// - analytics: the analytics tracker embedded in the document head, or `nil` (the default) to omit it.
|
||||
@@ -46,6 +50,7 @@ struct ShopPage {
|
||||
inventory: [Listing],
|
||||
matches: [Listing],
|
||||
parameters: SearchParameters,
|
||||
pickups: [Event] = [],
|
||||
viewer: Viewer? = nil,
|
||||
assetVersion: String? = nil,
|
||||
analytics: Analytics? = nil
|
||||
@@ -64,6 +69,7 @@ struct ShopPage {
|
||||
self.locale = .init(identifier: "en")
|
||||
self.pages = (slice.current, slice.total)
|
||||
self.parameters = parameters
|
||||
self.pickups = pickups
|
||||
self.shop = shop
|
||||
}
|
||||
|
||||
@@ -104,6 +110,12 @@ extension ShopPage: Page {
|
||||
}
|
||||
p(.class("type-body-sm shop__standing")) {
|
||||
"\(shop.standing) · \(shop.shipsNote)"
|
||||
if let event = pickups.first {
|
||||
" · trading at "
|
||||
a(.href(.Route.events)) {
|
||||
"\(event.name), \(Date.span(from: event.startsOn, to: event.endsOn))"
|
||||
}
|
||||
}
|
||||
}
|
||||
p(.class("shop__about")) {
|
||||
shop.about
|
||||
@@ -197,10 +209,12 @@ extension ShopPage: Page {
|
||||
if listings.isEmpty {
|
||||
div(.class("empty")) {
|
||||
h2(.class("type-panel")) {
|
||||
"Nothing here right now"
|
||||
counts.isEmpty ? "\(shop.name) is restocking" : "Nothing here right now"
|
||||
}
|
||||
p(.class("type-body-sm")) {
|
||||
"No listing in this shop matches those filters."
|
||||
counts.isEmpty
|
||||
? "Nothing listed right now\(pickups.first.map { " — the shop is trading at \($0.name), \(Date.span(from: $0.startsOn, to: $0.endsOn))" } ?? "")."
|
||||
: "No listing in this shop matches those filters."
|
||||
}
|
||||
a(
|
||||
.class("button button--outline"),
|
||||
|
||||
Reference in new issue
Block a user