Implemented phase 1 for the POC prototype in the Website service.
This commit is contained in:
1 parent
6d7ab4bcba
commit
ea89ea892a
37 files changed
+4173
-43
No files matched your search
@@ -11,6 +11,9 @@ struct SiteLayout<Content: HTML>: HTML {
|
||||
/// The screen's markup, rendered inside the `main` landmark.
|
||||
let content: Content
|
||||
|
||||
/// The text the header's search field is filled with, or `nil` to leave it empty.
|
||||
let query: String?
|
||||
|
||||
/// The signed-in viewer, or `nil` to render the signed-out header.
|
||||
let viewer: Viewer?
|
||||
|
||||
@@ -19,15 +22,18 @@ struct SiteLayout<Content: HTML>: HTML {
|
||||
/// Creates a site layout around a screen's content.
|
||||
/// - Parameters:
|
||||
/// - active: the format marked as current, or `nil` (the default) for none.
|
||||
/// - query: the text the header's search field is filled with, or `nil` (the default) to leave it empty.
|
||||
/// - viewer: the signed-in viewer, or `nil` (the default) to render the signed-out header.
|
||||
/// - content: the screen's markup.
|
||||
init(
|
||||
active: Format? = nil,
|
||||
query: String? = nil,
|
||||
viewer: Viewer? = nil,
|
||||
@HTMLBuilder content: () -> Content
|
||||
) {
|
||||
self.active = active
|
||||
self.content = content()
|
||||
self.query = query
|
||||
self.viewer = viewer
|
||||
}
|
||||
|
||||
@@ -42,6 +48,7 @@ struct SiteLayout<Content: HTML>: HTML {
|
||||
}
|
||||
SiteHeader(
|
||||
active: active,
|
||||
query: query,
|
||||
viewer: viewer
|
||||
)
|
||||
main(.id("main")) {
|
||||
|
||||
Reference in new issue
Block a user