small fix
This commit is contained in:
parent
1a410072c2
commit
14ba148284
2 changed files with 74 additions and 29 deletions
|
|
@ -132,35 +132,6 @@ fn handle_server_message(model: Model, notify_client) {
|
|||
fn view(model: Model) -> Element(Msg) {
|
||||
let #(question, lobby) = model.lobby
|
||||
element.fragment([
|
||||
html.div([attribute.class("terminal-prompt")], [
|
||||
case model.state {
|
||||
AskName ->
|
||||
case model.players {
|
||||
[] -> input_new_player(ReceiveName)
|
||||
_ ->
|
||||
view_players(
|
||||
list.map(model.players, fn(player) {
|
||||
let #(id, #(name, _)) = player
|
||||
#(id, name)
|
||||
}),
|
||||
AcceptName,
|
||||
)
|
||||
}
|
||||
NameOk(name) -> {
|
||||
shared.confirm_cells(
|
||||
Some("Join as this player: " <> name <> "?"),
|
||||
#("", name),
|
||||
AcceptName,
|
||||
)
|
||||
}
|
||||
Answer(name) ->
|
||||
step_prompt(
|
||||
"The Quiz Lead will now ask the question, and you may answer.",
|
||||
fn() { view_named_input(name, GiveAnswer) },
|
||||
)
|
||||
_ -> html.h3([], [html.text("Waiting for next question")])
|
||||
},
|
||||
]),
|
||||
html.div([class("terminal-header")], [
|
||||
html.div([class("terminal-status")], [
|
||||
html.span([class("status-blink")], [html.text("●")]),
|
||||
|
|
@ -179,6 +150,46 @@ fn view(model: Model) -> Element(Msg) {
|
|||
]),
|
||||
]),
|
||||
]),
|
||||
|
||||
case model.state {
|
||||
AskName -> {
|
||||
html.div([class("participants-grid")], [
|
||||
case model.players {
|
||||
[] -> input_new_player(ReceiveName)
|
||||
_ ->
|
||||
view_players(
|
||||
list.map(model.players, fn(player) {
|
||||
let #(id, #(name, _)) = player
|
||||
#(id, name)
|
||||
}),
|
||||
AcceptName,
|
||||
)
|
||||
},
|
||||
])
|
||||
}
|
||||
NameOk(name) -> {
|
||||
html.div([class("participants-grid")], [
|
||||
shared.confirm_cells(
|
||||
Some("Join as this player: " <> name <> "?"),
|
||||
#("", name),
|
||||
AcceptName,
|
||||
),
|
||||
])
|
||||
}
|
||||
Answer(name) -> {
|
||||
html.div([attribute.class("terminal-prompt")], [
|
||||
step_prompt(
|
||||
"The Quiz Lead will now ask the question, and you may answer.",
|
||||
fn() { view_named_input(name, GiveAnswer) },
|
||||
),
|
||||
])
|
||||
}
|
||||
_ -> {
|
||||
html.div([attribute.class("terminal-prompt")], [
|
||||
html.h3([], [html.text("Waiting for next question")]),
|
||||
])
|
||||
}
|
||||
},
|
||||
html.div([class("terminal-section")], case lobby {
|
||||
[] -> []
|
||||
lobby -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue