Improve change theme and star on github buttons

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-23 00:13:18 -06:00
parent bfe48d25fc
commit 7798d858f6
3 changed files with 14 additions and 24 deletions
@@ -53,6 +53,7 @@ func ChangeThemeButton(params ChangeThemeButtonParams) gomponents.Node {
components.Classes{
"btn btn-neutral space-x-1": true,
"btn-sm": params.Size == SizeSm,
"btn-lg": params.Size == SizeLg,
},
html.Div(
+12 -23
View File
@@ -1,33 +1,22 @@
package component
import (
lucide "github.com/eduardolat/gomponents-lucide"
"github.com/maragudk/gomponents"
"github.com/maragudk/gomponents/components"
"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"),
return html.A(
components.Classes{
"btn btn-neutral": true,
"btn-sm": size == SizeSm,
"btn-lg": size == SizeLg,
},
html.Href("https://github.com/eduardolat/pgbackweb"),
html.Target("_blank"),
lucide.Github(),
SpanText("Star on GitHub"),
)
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
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ func Auth(params AuthParams) gomponents.Node {
component.ChangeThemeButton(component.ChangeThemeButtonParams{
Position: component.DropdownPositionTop,
AlignsToEnd: false,
Size: component.SizeSm,
Size: component.SizeMd,
}),
component.StarOnGithub(component.SizeMd),
),