mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-05-12 14:38:28 -05:00
Improve change theme and star on github buttons
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user