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.

39 lines
902 B

4 years ago
  1. package nova.monadic_sfx.pages
  2. import nova.monadic_sfx.AppTypes
  3. import scalafx.scene.control.TextField
  4. import scalafx.scene.control._
  5. import scalafx.scene.layout.VBox
  6. import scalafx.scene.Node
  7. import scalafx.Includes._
  8. import scalafx.scene.layout.HBox
  9. import scalafx.scene.text.Text
  10. import scalafx.scene.Parent
  11. import scalafx.application.JFXApp.PrimaryStage
  12. class HomePage(
  13. backend: AppTypes.HttpBackend,
  14. system: akka.actor.ActorSystem,
  15. onLogout: () => Unit
  16. ) {
  17. private lazy val root = new HBox {
  18. children = List(
  19. new Text {
  20. text = "hello"
  21. },
  22. new Button {
  23. text = "logout"
  24. onAction = () => onLogout()
  25. }
  26. )
  27. }
  28. def render = root
  29. }
  30. object HomePage {
  31. def apply(
  32. backend: AppTypes.HttpBackend,
  33. system: akka.actor.ActorSystem,
  34. onLogout: () => Unit
  35. ): Parent =
  36. new HomePage(backend, system, onLogout).render
  37. }