mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-22 06:28:54 +00:00
format button only when there is a JSON element.
This commit is contained in:
@@ -35,6 +35,8 @@ 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.result.map {
|
||||||
|
case Right(_: Event) =>
|
||||||
button(
|
button(
|
||||||
Styles.button,
|
Styles.button,
|
||||||
"format",
|
"format",
|
||||||
@@ -45,7 +47,9 @@ object Main extends IOWebApp {
|
|||||||
.getOrElse(original)
|
.getOrElse(original)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
),
|
)
|
||||||
|
case _ => div("")
|
||||||
|
},
|
||||||
button(
|
button(
|
||||||
Styles.button,
|
Styles.button,
|
||||||
"generate event",
|
"generate event",
|
||||||
|
|||||||
Reference in New Issue
Block a user