Add login prompt for game invite links
When unauthenticated users visit a game invite link, show a prompt with options to log in, register, or continue as guest. After login/register, redirect back to the original game URL.
This commit is contained in:
26
ui/lobby.go
26
ui/lobby.go
@@ -67,3 +67,29 @@ func NicknamePrompt(nicknameBind, setNicknameKeyDown, setNicknameClick h.H) h.H
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
func GameJoinPrompt(loginClick, guestClick, registerClick h.H) h.H {
|
||||
return h.Main(h.Class("container"),
|
||||
h.Div(h.Class("lobby"),
|
||||
h.H1(h.Text("Join Game")),
|
||||
h.P(h.Text("Log in to track your game history, or continue as a guest.")),
|
||||
h.Div(h.Class("join-options"),
|
||||
h.Button(
|
||||
h.Type("button"),
|
||||
h.Text("Login"),
|
||||
loginClick,
|
||||
),
|
||||
h.Button(
|
||||
h.Type("button"),
|
||||
h.Class("secondary"),
|
||||
h.Text("Continue as Guest"),
|
||||
guestClick,
|
||||
),
|
||||
),
|
||||
h.P(h.Class("register-link"),
|
||||
h.Text("Don't have an account? "),
|
||||
h.A(h.Href("#"), h.Text("Register"), registerClick),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user