feat: add back to lobby navigation on game pages

This commit is contained in:
Ryan Hamamura
2026-02-05 09:55:43 -10:00
parent 73128dc119
commit 0279615b36
2 changed files with 6 additions and 0 deletions

View File

@@ -483,6 +483,7 @@ func main() {
var content []h.H var content []h.H
content = append(content, content = append(content,
ui.BackToLobby(),
h.H1(h.Class("text-3xl font-bold"), h.Text("Connect 4")), h.H1(h.Class("text-3xl font-bold"), h.Text("Connect 4")),
ui.PlayerInfo(g, myColor), ui.PlayerInfo(g, myColor),
ui.StatusBanner(g, myColor, createRematch.OnClick()), ui.StatusBanner(g, myColor, createRematch.OnClick()),
@@ -630,6 +631,7 @@ func main() {
var content []h.H var content []h.H
content = append(content, content = append(content,
ui.BackToLobby(),
h.H1(h.Class("text-3xl font-bold"), h.Text("Snake")), h.H1(h.Class("text-3xl font-bold"), h.Text("Snake")),
ui.SnakePlayerList(sg, mySlot), ui.SnakePlayerList(sg, mySlot),
ui.SnakeStatusBanner(sg, mySlot, createRematch.OnClick()), ui.SnakeStatusBanner(sg, mySlot, createRematch.OnClick()),

View File

@@ -25,6 +25,10 @@ type LobbyProps struct {
SpeedSelectClicks []h.H SpeedSelectClicks []h.H
} }
func BackToLobby() h.H {
return h.A(h.Class("link text-sm opacity-70"), h.Href("/"), h.Text("← Back to Lobby"))
}
func LobbyView(p LobbyProps) h.H { func LobbyView(p LobbyProps) h.H {
var authSection h.H var authSection h.H
if p.IsLoggedIn { if p.IsLoggedIn {