feat: add back to lobby navigation on game pages
This commit is contained in:
2
main.go
2
main.go
@@ -483,6 +483,7 @@ func main() {
|
||||
|
||||
var content []h.H
|
||||
content = append(content,
|
||||
ui.BackToLobby(),
|
||||
h.H1(h.Class("text-3xl font-bold"), h.Text("Connect 4")),
|
||||
ui.PlayerInfo(g, myColor),
|
||||
ui.StatusBanner(g, myColor, createRematch.OnClick()),
|
||||
@@ -630,6 +631,7 @@ func main() {
|
||||
|
||||
var content []h.H
|
||||
content = append(content,
|
||||
ui.BackToLobby(),
|
||||
h.H1(h.Class("text-3xl font-bold"), h.Text("Snake")),
|
||||
ui.SnakePlayerList(sg, mySlot),
|
||||
ui.SnakeStatusBanner(sg, mySlot, createRematch.OnClick()),
|
||||
|
||||
@@ -25,6 +25,10 @@ type LobbyProps struct {
|
||||
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 {
|
||||
var authSection h.H
|
||||
if p.IsLoggedIn {
|
||||
|
||||
Reference in New Issue
Block a user