feat: Mostly working user view with elementary html.
This commit is contained in:
26
Sources/App/Views/RouteHeaderView.swift
Normal file
26
Sources/App/Views/RouteHeaderView.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
import Elementary
|
||||
import ElementaryHTMX
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user