Add StarOnGithub component and update auth layout

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-22 23:57:03 -06:00
parent 5f1677be14
commit 081ce0cf12
2 changed files with 38 additions and 1 deletions
@@ -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
}
}
+5 -1
View File
@@ -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),
),
),
},
})