| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package app
- var (
- // NotFound is the ui element that is displayed when a request is not
- // routed.
- NotFound UI = ¬Found{}
- )
- type notFound struct {
- Compo
- Icon string
- }
- func (n *notFound) OnMount(Context) {
- links := Window().Get("document").Call("getElementsByTagName", "link")
- for i := 0; i < links.Length(); i++ {
- link := links.Index(i)
- rel := link.Call("getAttribute", "rel")
- if rel.String() == "icon" {
- favicon := link.Call("getAttribute", "href")
- n.Icon = favicon.String()
- return
- }
- }
- }
- func (n *notFound) Render() UI {
- return Div().
- Class("goapp-app-info").
- Body(
- Div().
- Class("goapp-notfound-title").
- Body(
- Text("4"),
- Img().
- Class("goapp-logo").
- Alt("0").
- Src(n.Icon),
- Text("4"),
- ),
- P().
- Class("goapp-label").
- Text("Not Found"),
- )
- }
|