circe codec derivation to models
This commit is contained in:
@@ -23,7 +23,7 @@ object Main {
|
||||
myId: Option[PlayerID]
|
||||
)
|
||||
// TODO is this ok for state creation? link with auth component and use in another?
|
||||
val appStateSignal = Var(AppState(Some(RoomStateView.me.id))).signal
|
||||
val appStateSignal = Var(AppState(Some(TestModels.me.id))).signal
|
||||
|
||||
def appElement(): Element = {
|
||||
div(
|
||||
@@ -32,7 +32,7 @@ object Main {
|
||||
className := "h-24 w-full flex flex-for justify-center items-center bg-green-200",
|
||||
p(className := "text-2xl", "Here be header"),
|
||||
),
|
||||
RoomView.renderRoom(RoomStateView.testRoom)
|
||||
RoomView.renderRoom(TestModels.testRoom)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ object TableView {
|
||||
myId: Option[PlayerID]
|
||||
): CardState = {
|
||||
state match {
|
||||
case isOpen: VotingRound =>
|
||||
case isOpen: RoundState.Voting =>
|
||||
if (myId.forall(_ == id)) {
|
||||
isOpen.myCard.fold(NoCard(name))(vote => Open(vote))
|
||||
} else isOpen.alreadyVoted.find(_.id == id).fold(NoCard(name))(_ => CardBack)
|
||||
case isClosed: ViewingRound =>
|
||||
case isClosed: RoundState.Viewing =>
|
||||
isClosed.votes
|
||||
.get(id)
|
||||
.fold {
|
||||
|
||||
Reference in New Issue
Block a user