feat: Some style updates, form improvements on project-room view.
This commit is contained in:
@@ -5,6 +5,8 @@ import Styleguide
|
||||
|
||||
struct ProjectForm: HTML, Sendable {
|
||||
|
||||
static let id = "projectForm"
|
||||
|
||||
let project: Project?
|
||||
let dismiss: Bool
|
||||
|
||||
@@ -17,7 +19,7 @@ struct ProjectForm: HTML, Sendable {
|
||||
}
|
||||
|
||||
var body: some HTML {
|
||||
ModalForm(id: "projectForm", dismiss: dismiss) {
|
||||
ModalForm(id: Self.id, dismiss: dismiss) {
|
||||
h1(.class("text-3xl font-bold pb-6 ps-2")) { "Project" }
|
||||
form(
|
||||
.class("space-y-4 p-4"),
|
||||
|
||||
@@ -80,7 +80,7 @@ struct Sidebar: HTML {
|
||||
div(.class("flex")) {
|
||||
// TODO: Move somewhere outside of the sidebar.
|
||||
button(
|
||||
.class("w-full btn btn-secondary"),
|
||||
.class("btn btn-secondary btn-block"),
|
||||
.hx.get(route: .project(.index)),
|
||||
.hx.target("body"),
|
||||
.hx.pushURL(true),
|
||||
|
||||
@@ -16,21 +16,17 @@ struct ProjectsTable: HTML, Sendable {
|
||||
}
|
||||
|
||||
var body: some HTML {
|
||||
div {
|
||||
div(.class("m-6")) {
|
||||
Row {
|
||||
h1(.class("text-2xl font-bold")) { "Projects" }
|
||||
div(
|
||||
.class("tooltip tooltip-left"),
|
||||
.data("tip", value: "Add project")
|
||||
) {
|
||||
button(
|
||||
.class("btn btn-primary w-[40px] text-2xl"),
|
||||
.hx.get(route: .project(.form(dismiss: false))),
|
||||
.hx.target("#projectForm"),
|
||||
.hx.swap(.outerHTML)
|
||||
) {
|
||||
"+"
|
||||
}
|
||||
PlusButton()
|
||||
.attributes(
|
||||
.showModal(id: ProjectForm.id)
|
||||
)
|
||||
}
|
||||
}
|
||||
.attributes(.class("pb-6"))
|
||||
@@ -75,9 +71,11 @@ extension ProjectsTable {
|
||||
.hx.target("closest tr")
|
||||
)
|
||||
a(
|
||||
.class("btn btn-success dark:text-white"),
|
||||
.class("btn btn-success btn-circle dark:text-white"),
|
||||
.href(route: .project(.detail(project.id, .index())))
|
||||
) { ">" }
|
||||
) {
|
||||
SVG(.chevronRight)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user