2024-09-11 17:31:40 +00:00
|
|
|
package partials
|
|
|
|
|
|
2024-09-13 17:26:53 +00:00
|
|
|
import (
|
2024-09-14 00:05:55 +00:00
|
|
|
"github.com/maddalax/htmgo/framework-ui/ui"
|
|
|
|
|
"github.com/maddalax/htmgo/framework/h"
|
2024-09-13 17:26:53 +00:00
|
|
|
)
|
2024-09-11 17:31:40 +00:00
|
|
|
|
2024-09-20 01:24:44 +00:00
|
|
|
func OpenSheetButton(open bool, children ...h.Ren) h.Ren {
|
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,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|