Skip to content

Commit ab80807

Browse files
committed
adding reports page to player's page
1 parent 78c2720 commit ab80807

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

apps/demo-game/src/components/DecisionsDisplay.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ function DecisionsDisplayCompact({ segmentDecisions }: DecisionDisplayProps) {
107107
<TableBody>
108108
{segmentDecisions.map((e) => {
109109
return (
110-
<TableRow key={e.segment.id}>
110+
<TableRow key={e.segment?.id}>
111111
<TableCell className="flex text-nowrap">
112-
P{e.period.index + 1} S{e.segment.index + 1}
112+
P{e.period?.index + 1} S{e.segment?.index + 1}
113113
</TableCell>
114114
<TableCell>
115115
<OnOffIcon on={e.decisions.bank} />

apps/demo-game/src/pages/play/cockpit.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ function GameLayout({ children }: { children: React.ReactNode }) {
124124
role: data.self.role,
125125
}
126126

127+
const tabs = [
128+
{
129+
name: 'Reports',
130+
href: `/admin/reports/${data?.result?.currentGame?.id}`,
131+
},
132+
]
133+
127134
const sidebar = (
128135
<div id="sidebar" className="flex flex-col justify-between">
129136
<Card
@@ -218,11 +225,6 @@ function GameLayout({ children }: { children: React.ReactNode }) {
218225
)
219226
}
220227

221-
const tabs = [
222-
{ name: 'Welcome', href: '/play/welcome' },
223-
{ name: 'Cockpit', href: '/play/cockpit' },
224-
]
225-
226228
const colors = [
227229
'hsl(var(--chart-1))',
228230
'hsl(var(--chart-2))',

packages/ui/src/components/NavBar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
NavigationMenuList,
88
navigationMenuTriggerStyle,
99
} from '@uzh-bf/design-system/dist/future'
10+
import { Button } from '@uzh-bf/design-system'
1011

1112
interface Props {
1213
tabs: { name: string; href: string }[]
@@ -23,7 +24,7 @@ function NavBar({
2324
playerLevel,
2425
playerColor,
2526
playerImgPathAvatar,
26-
playerHref = '/play/cockpit',
27+
playerHref = '/play/welcome',
2728
}: Props) {
2829
return (
2930
<>
@@ -48,7 +49,9 @@ function NavBar({
4849
<div className="text-orange-700">Level {playerLevel}</div>
4950
</div>
5051
<div className="w-10">
51-
<Logo imgPathAvatar={playerImgPathAvatar} color={playerColor} />
52+
<Button className={{ root: 'p-0 hover:' }}>
53+
<Logo imgPathAvatar={playerImgPathAvatar} color={playerColor} />
54+
</Button>
5255
</div>
5356
</div>
5457
</Link>

0 commit comments

Comments
 (0)