feat: Working on layout / css.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Elementary
|
||||
import ElementaryHTMX
|
||||
|
||||
struct MainPage<Inner: HTML>: HTMLDocument {
|
||||
struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable {
|
||||
|
||||
var title: String { "Purchase Orders" }
|
||||
|
||||
@@ -38,7 +38,29 @@ struct MainPage<Inner: HTML>: HTMLDocument {
|
||||
}
|
||||
}
|
||||
|
||||
extension MainPage: Sendable where Inner: Sendable {}
|
||||
struct RouteHeaderView: HTML {
|
||||
|
||||
let title: String
|
||||
let description: String
|
||||
|
||||
init(title: String, description: String) {
|
||||
self.title = title
|
||||
self.description = description
|
||||
}
|
||||
|
||||
init(route: ViewRoute) {
|
||||
self.init(title: route.title, description: route.description)
|
||||
}
|
||||
|
||||
var content: some HTML {
|
||||
div(.class("container"), .style("padding: 20px 20px;")) {
|
||||
h1 { title }
|
||||
br()
|
||||
p { description }
|
||||
br()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Logo: HTML, Sendable {
|
||||
|
||||
@@ -48,3 +70,5 @@ struct Logo: HTML, Sendable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protocol SendableHTMLDocument: HTMLDocument, Sendable {}
|
||||
|
||||
Reference in New Issue
Block a user