Skip to content

Commit

Permalink
wip(setUp): add back button
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-borriello00 committed Sep 6, 2023
1 parent 8ad6604 commit 0092a30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/main/scala/scatan/controllers/setup/SetUpController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ package scatan.controllers.setup

import scatan.mvc.lib.Controller
import scatan.views.setup.SetUpView
import scatan.mvc.lib.NavigableApplicationManager
import scatan.Pages

trait SetUpController extends Controller
trait SetUpController extends Controller:
def goToHome(): Unit
def goToPlay(): Unit

class SetUpControllerImpl(dependencies: Controller.Requirements[SetUpView, ?]) extends SetUpController
class SetUpControllerImpl(dependencies: Controller.Requirements[SetUpView, ?]) extends SetUpController:
override def goToHome(): Unit = NavigableApplicationManager.navigateTo(Pages.Home)
// TODO: implement goToPlay
override def goToPlay(): Unit = NavigableApplicationManager.navigateTo(Pages.Home)
7 changes: 6 additions & 1 deletion src/main/scala/scatan/views/setup/ScalaJsSetUpView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ class ScalaJsSetUpView(requirements: View.Requirements[SetUpController], contain
),
button(
cls := "setup-menu-button",
onClick.mapTo(Pages.Home) --> NavigableApplicationManager.navigateTo,
onClick --> (_ => controller.goToHome()),
"Back"
),
button(
cls := "setup-menu-button",
onClick --> (_ => controller.goToPlay()),
"Start"
)
)
Expand Down

0 comments on commit 0092a30

Please sign in to comment.