mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-09 09:08:50 +00:00
using nostr-tools with a facade.
This commit is contained in:
@@ -7,6 +7,7 @@ import slinky.web.html._
|
||||
import slinky.core.facade.Hooks._
|
||||
import slinky.core.facade.Fragment
|
||||
|
||||
import app.modules.Nostr
|
||||
import app.handlers.{Handler}
|
||||
import app.components.{Item}
|
||||
|
||||
@@ -19,7 +20,9 @@ object KeyHandling extends Handler {
|
||||
override val component = FunctionalComponent[String] { props =>
|
||||
Fragment(
|
||||
Item.component(Item.props("private key", "", props)),
|
||||
Item.component(Item.props("public key", "", "soon to be shown here"))
|
||||
Item.component(
|
||||
Item.props("public key", "", Nostr.getPublicKey(props))
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
10
src/main/scala/app/modules/Nostr.scala
Normal file
10
src/main/scala/app/modules/Nostr.scala
Normal file
@@ -0,0 +1,10 @@
|
||||
package app.modules
|
||||
|
||||
import scala.scalajs.js.annotation._
|
||||
import scala.scalajs.js
|
||||
|
||||
@js.native
|
||||
@JSGlobal
|
||||
object Nostr extends js.Object {
|
||||
def getPublicKey(text: String): String = js.native
|
||||
}
|
||||
Reference in New Issue
Block a user