mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
add "clear" button.
This commit is contained in:
parent
ed16607a36
commit
b1d9c9d5bf
|
@ -45,6 +45,15 @@ object Main extends IOWebApp {
|
||||||
def actions(store: Store): Resource[IO, HtmlDivElement[IO]] =
|
def actions(store: Store): Resource[IO, HtmlDivElement[IO]] =
|
||||||
div(
|
div(
|
||||||
cls := "flex flex-col space-y-1 my-3",
|
cls := "flex flex-col space-y-1 my-3",
|
||||||
|
store.input.map {
|
||||||
|
case "" => div("")
|
||||||
|
case _ =>
|
||||||
|
button(
|
||||||
|
Styles.button,
|
||||||
|
"clear",
|
||||||
|
onClick --> (_.foreach(_ => store.input.set("")))
|
||||||
|
)
|
||||||
|
},
|
||||||
store.result.map {
|
store.result.map {
|
||||||
case Right(_: Event) =>
|
case Right(_: Event) =>
|
||||||
button(
|
button(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user