From 61254404dcf4c28442729544a529adb982a67e3f Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Fri, 1 Dec 2017 16:00:24 +0100 Subject: [PATCH] Fix compat with last vecty changes --- router/anchor.go | 12 +++++++----- router/body.go | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/router/anchor.go b/router/anchor.go index a20718c..b70e6ac 100644 --- a/router/anchor.go +++ b/router/anchor.go @@ -26,22 +26,24 @@ func (a *anchor) onClick(_ *vecty.Event) { } // Render implements vecty.Component -func (a *anchor) Render() *vecty.HTML { +func (a *anchor) Render() vecty.ComponentOrHTML { return elem.Anchor( - prop.Href(`javascript:;`), - event.Click(a.onClick).PreventDefault().StopPropagation(), + vecty.Markup( + prop.Href(`javascript:;`), + event.Click(a.onClick).PreventDefault().StopPropagation(), + ), a.children, ) } // LinkWithParams wraps the provided content in an anchor tag that transitions // to a new location with URL parameters on click. -func LinkWithParams(path string, params url.Values, content vecty.ComponentOrHTML) vecty.MarkupOrComponentOrHTML { +func LinkWithParams(path string, params url.Values, content vecty.ComponentOrHTML) vecty.ComponentOrHTML { return &anchor{path: path, params: params, children: content} } // Link wraps the provided content in an anchor tag that transitions to a new // location on click. -func Link(path string, content vecty.ComponentOrHTML) vecty.MarkupOrComponentOrHTML { +func Link(path string, content vecty.ComponentOrHTML) vecty.ComponentOrHTML { return LinkWithParams(path, nil, content) } diff --git a/router/body.go b/router/body.go index c119a42..ab1ffb5 100644 --- a/router/body.go +++ b/router/body.go @@ -21,9 +21,9 @@ func (b *body) OnRoute(ctx Context) { } // Render implements vecty.Component -func (b *body) Render() *vecty.HTML { +func (b *body) Render() vecty.ComponentOrHTML { return elem.Body( - prop.ID(`Body`), + vecty.Markup(prop.ID(`Body`)), b.children, ) }