feat: Working on layout / css.

This commit is contained in:
2025-01-15 14:31:36 -05:00
parent cf28e52fa2
commit 24570e7191
15 changed files with 285 additions and 118 deletions

View File

@@ -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 {}