htmgo/starter-template/partials/button.go

27 lines
657 B
Go
Raw Normal View History

2024-09-11 17:31:40 +00:00
package partials
2024-09-13 17:26:53 +00:00
import (
"github.com/maddalax/mhtml/framework-ui/ui"
"github.com/maddalax/mhtml/framework/h"
)
2024-09-11 17:31:40 +00:00
func OpenSheetButton(open bool, children ...h.Renderable) h.Renderable {
2024-09-11 17:31:40 +00:00
if open {
return ui.PrimaryButton(ui.ButtonProps{
Id: "open-sheet",
Text: "Close NewsSheet",
Target: "#sheet-partial",
Get: h.GetPartialPathWithQs(NewsSheet, "open=false"),
Children: children,
})
} else {
return ui.PrimaryButton(ui.ButtonProps{
Id: "open-sheet",
Text: "Open NewsSheet",
Target: "#sheet-partial",
Get: h.GetPartialPathWithQs(NewsSheet, "open=true"),
Children: children,
})
}
}