Skip to content

Commit

Permalink
add event title to boulder ranking view
Browse files Browse the repository at this point in the history
  • Loading branch information
schaschjan committed Sep 18, 2024
1 parent 63e4b34 commit 5035abe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pages/[location]/boulder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export default function Page() {
hasRole("ROLE_ADMIN") && query.forUser
? `/api/${currentLocation?.url}/users/${query.forUser}`
: null,
fetcher
fetcher,
);

const { data: event, isLoading: eventIsLoading } = useSWR<Event>(
query.forEvent
? `/api/${currentLocation?.url}/events/${query.forEvent}`
: null,
fetcher
fetcher,
);

const { data: boulders } = useSWR<Boulder[]>(
`/api/${currentLocation?.url}/boulders`,
fetcher
fetcher,
);

if (!boulders || eventIsLoading) {
Expand Down Expand Up @@ -74,7 +74,8 @@ export default function Page() {
return (
<>
<h1 className={utilities.typograpy.alpha700}>
Boulder ({event ? event.boulders.length : boulders?.length})
{event ? event.name : null} Boulder (
{event ? event.boulders.length : boulders?.length})
</h1>

<BoulderView
Expand Down

0 comments on commit 5035abe

Please sign in to comment.