From 86da2adabfff985270f51ff834e7f206893df5c9 Mon Sep 17 00:00:00 2001 From: jajakob Date: Sat, 28 Dec 2024 11:00:31 +0100 Subject: [PATCH] adding reports page to player's page --- .../src/components/DecisionsDisplay.tsx | 4 ++-- apps/demo-game/src/pages/play/cockpit.tsx | 12 +++++++----- apps/demo-game/src/pages/play/welcome.tsx | 17 ++++++++--------- packages/ui/src/components/NavBar.tsx | 7 +++++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/apps/demo-game/src/components/DecisionsDisplay.tsx b/apps/demo-game/src/components/DecisionsDisplay.tsx index b260f099..ec3d73d5 100644 --- a/apps/demo-game/src/components/DecisionsDisplay.tsx +++ b/apps/demo-game/src/components/DecisionsDisplay.tsx @@ -107,9 +107,9 @@ function DecisionsDisplayCompact({ segmentDecisions }: DecisionDisplayProps) { {segmentDecisions.map((e) => { return ( - + - P{e.period.index + 1} S{e.segment.index + 1} + P{e.period?.index + 1} S{e.segment?.index + 1} diff --git a/apps/demo-game/src/pages/play/cockpit.tsx b/apps/demo-game/src/pages/play/cockpit.tsx index 2d451a84..4cc1389f 100644 --- a/apps/demo-game/src/pages/play/cockpit.tsx +++ b/apps/demo-game/src/pages/play/cockpit.tsx @@ -124,6 +124,13 @@ function GameLayout({ children }: { children: React.ReactNode }) { role: data.self.role, } + const tabs = [ + { + name: 'Reports', + href: `/admin/reports/${data?.result?.currentGame?.id}`, + }, + ] + const sidebar = (
- - ({ @@ -177,13 +176,13 @@ function Welcome() { }} /> - ({ diff --git a/packages/ui/src/components/NavBar.tsx b/packages/ui/src/components/NavBar.tsx index 6405c0f3..162d541f 100644 --- a/packages/ui/src/components/NavBar.tsx +++ b/packages/ui/src/components/NavBar.tsx @@ -7,6 +7,7 @@ import { NavigationMenuList, navigationMenuTriggerStyle, } from '@uzh-bf/design-system/dist/future' +import { Button } from '@uzh-bf/design-system' interface Props { tabs: { name: string; href: string }[] @@ -23,7 +24,7 @@ function NavBar({ playerLevel, playerColor, playerImgPathAvatar, - playerHref = '/play/cockpit', + playerHref = '/play/welcome', }: Props) { return ( <> @@ -48,7 +49,9 @@ function NavBar({
Level {playerLevel}
- +