Skip to content

Commit

Permalink
feat(ui): replace send confirmation with disabled button
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Jul 31, 2024
1 parent 22009b6 commit f115ae8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ func handleSendInvoice(c *fiber.Ctx) error {
// Not sure why this is the case, but probably worth revisiting in the future.
return c.SendString("Failed :(")
}
return c.SendString("Queued!")
return c.SendString("<button class=\"btn-disabled\" disabled>Queued!</button>")
}
5 changes: 5 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ hr {
background-color: #ac0800;
}

.btn-disabled {
background-color: #777;
color: #fff !important;
}

#modal {
/* Underlay covers entire screen. */
position: fixed;
Expand Down
3 changes: 1 addition & 2 deletions views/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ <h2>{{ .Name }}</h2>
class="btn-primary"
hx-post="/invoice/{{.ID}}"
hx-indicator="#spinner"
hx-swap="innerHTML"
hx-confirm="Are you sure you want to send {{.Name}}'s invoice?"
hx-swap="outerHTML"
hx-target="this"
href=""
>
Expand Down

0 comments on commit f115ae8

Please sign in to comment.