2024-09-11 17:31:40 +00:00
|
|
|
package partials
|
|
|
|
|
|
2024-09-13 17:13:01 +00:00
|
|
|
import "github.com/maddalax/mhtml/framework/h"
|
2024-09-11 17:31:40 +00:00
|
|
|
|
2024-09-11 23:41:21 +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,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|