mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 10:21:40 +00:00
refactor: refactor authentication pages into their own modules
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package ui
|
||||
|
||||
import "fmt"
|
||||
|
||||
type FontAwesome string
|
||||
|
||||
type IconFunc func(name string) templ.Component
|
||||
|
||||
const (
|
||||
FaSolid FontAwesome = "fa-solid"
|
||||
FaRegular FontAwesome = "fa-regular"
|
||||
FaLight FontAwesome = "fa-light"
|
||||
FaThin FontAwesome = "fa-thin"
|
||||
FaDuotone FontAwesome = "fa-duotone fa-solid"
|
||||
|
||||
FaSharpSolid FontAwesome = "fa-sharp fa-solid"
|
||||
FaSharpRegular FontAwesome = "fa-sharp fa-regular"
|
||||
FaSharpLight FontAwesome = "fa-sharp fa-light"
|
||||
FaSharpThin FontAwesome = "fa-sharp fa-thin"
|
||||
FaSharpDuotone FontAwesome = "fa-sharp-duotone fa-solid"
|
||||
|
||||
FaBrands FontAwesome = "fa-brands"
|
||||
)
|
||||
|
||||
func (s FontAwesome) Icon(name string) templ.Component {
|
||||
return renderIcon(s, name)
|
||||
}
|
||||
|
||||
func renderIcon(s FontAwesome, name string) templ.Component {
|
||||
return faIcon(formatIconClass(s, name))
|
||||
}
|
||||
|
||||
func formatIconClass(s FontAwesome, name string) string {
|
||||
return fmt.Sprintf("%s %s", string(s), name)
|
||||
}
|
||||
|
||||
templ faIcon(class string) {
|
||||
<i class={ class }></i>
|
||||
}
|
||||
Reference in New Issue
Block a user