diff --git a/internal/view/web/component/star_on_github.go b/internal/view/web/component/star_on_github.go new file mode 100644 index 0000000..9974740 --- /dev/null +++ b/internal/view/web/component/star_on_github.go @@ -0,0 +1,33 @@ +package component + +import ( + "github.com/maragudk/gomponents" + "github.com/maragudk/gomponents/html" +) + +func StarOnGithub(size size) gomponents.Node { + small := html.IFrame( + html.Src("https://ghbtns.com/github-btn.html?user=eduardolat&repo=pgbackweb&type=star&count=true"), + gomponents.Attr("frameborder", "0"), + gomponents.Attr("scrolling", "0"), + html.Width("150"), + html.Height("20"), + ) + + big := html.IFrame( + html.Src("https://ghbtns.com/github-btn.html?user=eduardolat&repo=pgbackweb&type=star&count=true&size=large"), + gomponents.Attr("frameborder", "0"), + gomponents.Attr("scrolling", "0"), + html.Width("170"), + html.Height("30"), + ) + + switch size { + case SizeSm: + return small + case SizeMd: + return big + default: + return big + } +} diff --git a/internal/view/web/layout/auth.go b/internal/view/web/layout/auth.go index c2c0a9b..c216208 100644 --- a/internal/view/web/layout/auth.go +++ b/internal/view/web/layout/auth.go @@ -51,7 +51,11 @@ func Auth(params AuthParams) gomponents.Node { html.Class("rounded-box shadow-md bg-base-100 p-4"), gomponents.Group(params.Body), ), - component.ChangeThemeButton(component.DropdownPositionTop, false), + html.Div( + html.Class("flex justify-between items-start"), + component.StarOnGithub(component.SizeMd), + component.ChangeThemeButton(component.DropdownPositionTop, false), + ), ), }, })