You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.0 KiB

package nova.monadic_sfx.screens
import akka.actor.typed._
import monix.eval.Task
import nova.monadic_sfx.AppTypes
import nova.monadic_sfx.implicits._
import scalafx.scene.Parent
import scalafx.scene.control._
import scalafx.scene.layout.HBox
import scalafx.scene.text.Text
class HomeScreen(
backend: AppTypes.HttpBackend,
system: ActorSystem[SpawnProtocol.Command],
onLogout: () => Task[Unit]
) {
val myButton = new Button {
id = "LogoutButton"
text = "logout"
// onAction = () => Action.asyncT(onLogout())
}
val myObs = myButton.observableAction
// myObs.foreachL(_ => ())
private lazy val root = Task {
new HBox {
children = List(
new Text {
text = "hello"
},
myButton
)
}
}
def render = root
}
object HomeScreen {
def apply(
backend: AppTypes.HttpBackend,
system: ActorSystem[SpawnProtocol.Command],
onLogout: () => Task[Unit]
): Task[Parent] =
new HomeScreen(backend, system, onLogout).render
}