diff --git a/widgets/force_editor.go b/widgets/force_editor.go index 64be42a..80158b3 100644 --- a/widgets/force_editor.go +++ b/widgets/force_editor.go @@ -1,9 +1,12 @@ package widgets import ( + "fmt" + "github.com/divan/graphx/layout" "github.com/gopherjs/vecty" "github.com/gopherjs/vecty/elem" + "github.com/gopherjs/vecty/event" ) type ForceEditor struct { @@ -25,6 +28,18 @@ func (l *ForceEditor) Render() vecty.ComponentOrHTML { ), vecty.List(l.inputs), ), + elem.Div( + elem.Button( + vecty.Markup( + vecty.Class("pure-button"), + vecty.Style("background", "rgb(28, 184, 65)"), + vecty.Style("color", "white"), + vecty.Style("border-radius", "4px"), + event.Click(l.onUpdateClick), + ), + vecty.Text("Update"), + ), + ), ) } @@ -44,3 +59,7 @@ func NewForceEditor() *ForceEditor { func (l *ForceEditor) Config() layout.Config { return l.config } + +func (l *ForceEditor) onUpdateClick(e *vecty.Event) { + fmt.Println("Clicked") +}