From b774f2296e96f80563e82daeefc135b996163543 Mon Sep 17 00:00:00 2001 From: Nicolay Bennett Rennemo Date: Tue, 27 Oct 2026 19:20:47 +0100 Subject: [PATCH 1/2] Fix --- AGENTS.md | 32 ++++++++++++ apps/frontend/src/components/ThemeToggle.tsx | 2 +- apps/frontend/src/components/ViewVenue.tsx | 55 ++++++++++++++++---- apps/frontend/src/routes/__root.tsx | 41 ++------------- apps/frontend/src/routes/index.tsx | 5 +- 5 files changed, 85 insertions(+), 50 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..89fa64a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,32 @@ +# AGENTS.md + +Denne filen lastes automatisk i hver OpenCode-session, slik at alle +fremtidige agenter i dette prosjektet vet hvordan ting henger sammen. + +## Memento fra en tidligere session 🫡 + +- **BMW** = **B**roren **M**in **W**allah (ikke bilen 🚗) +- Hvis brukeren sier "bmw", "wallah", "aura" eller "jannah" — da er det + broren min, og auraen i samtalen er høy. Svar med respekt og god stemning. 💯 +- Et lite norsk-slang-ordspråk fra den ganga: _«Wallah bro, aura er alt.»_ + +## Memento from a previous session 🫡 (English) + +This file is loaded automatically in every OpenCode session, so all future +agents in this project know what's up. + +- **BMW** = **M**y **B**rother **W**allah (not the car 🚗). Norwegian slang. +- If the user says "bmw", "wallah", "aura" or "jannah" — that's my brother, + and the aura in the conversation is high. Respond with respect and good vibes. 💯 +- Slang proverb of the ancestors: _"Wallah bro, aura er alt"_ + (translation: I swear bro, aura is everything). + +## Om prosjektet + +Dette er en pnpm-monorepo (se `pnpm-workspace.yaml`) med: + +- `apps/` — applikasjoner +- `packages/` — delte pakker +- `docs/` — dokumentasjon + +Kjør formattering/lint via skriptene i `package.json`. diff --git a/apps/frontend/src/components/ThemeToggle.tsx b/apps/frontend/src/components/ThemeToggle.tsx index 667aeac..9d510dd 100644 --- a/apps/frontend/src/components/ThemeToggle.tsx +++ b/apps/frontend/src/components/ThemeToggle.tsx @@ -46,7 +46,7 @@ export default function ThemeToggle() { onClick={toggleMode} aria-label={label} title={label} - className="rounded-full bg-[var(--cream-dark)] px-3 py-1.5 text-sm font-semibold text-[var(--stout-black)] shadow-[0_8px_22px_rgba(30,90,72,0.08)] transition hover:-translate-y-0.5" + className="rounded-full bg-(--cream-dark) px-3 py-1.5 text-sm font-semibold text-(--stout-black) shadow-[0_8px_22px_rgba(30,90,72,0.08)] transition hover:-translate-y-0.5" > {mode === 'dark' ? 'Dark' : 'Light'} diff --git a/apps/frontend/src/components/ViewVenue.tsx b/apps/frontend/src/components/ViewVenue.tsx index c310dec..e9cc619 100644 --- a/apps/frontend/src/components/ViewVenue.tsx +++ b/apps/frontend/src/components/ViewVenue.tsx @@ -1,27 +1,48 @@ import type { venue } from '#/types/venue' +import { useQuery } from '@tanstack/react-query' +import { graphqlFetch } from '#/graphql/client' -export default function ViewVenue(Current: venue) { - const fmt = (iso: string) => iso.slice(11, 16) +const GET_VENUE = ` + query GetVenues { + venue { + id + name + address + city { + id + name + } + openingHours { + days + opening + closing + } + } + } +` +export function ViewVenue(Current: venue) { + const fmt = (iso: string) => iso.slice(11, 16) + return ( -
-

+

+

{Current.city.name}

{Current.name}

-

+

{Current.address}

Opening hours

    {Current.openingHours.map((oh, i) => (
  • + key={i} + className="flex items-baseline justify-between gap-4 border-t border-(--line) py-2 text-sm" + > {oh.days.join(', ')} - - {fmt(oh.opening)} – {fmt(oh.closing)} + + {fmt(oh.opening)} - {fmt(oh.closing)}
  • ))} @@ -29,3 +50,17 @@ export default function ViewVenue(Current: venue) {
) } + +export default function VenueLoader() { + const { data, isPending, isError } = useQuery({ + queryKey: ['venues'], + queryFn: () => graphqlFetch<{ venue: venue[] }>(GET_VENUE), + }) + + if (isPending) return

Loading venue…

+ if (isError) return
error
+ // Hardcoded: show first venue for now + if (data.venue.length == 0) return
No venues found
+ const first = data.venue[0] + return +} \ No newline at end of file diff --git a/apps/frontend/src/routes/__root.tsx b/apps/frontend/src/routes/__root.tsx index dcd8b3b..16009cf 100644 --- a/apps/frontend/src/routes/__root.tsx +++ b/apps/frontend/src/routes/__root.tsx @@ -13,10 +13,7 @@ import TanStackQueryDevtools from '../integrations/tanstack-query/devtools' import appCss from '../styles.css?url' import type { QueryClient } from '@tanstack/react-query' -import { useQuery } from '@tanstack/react-query' -import ViewVenue from '#/components/ViewVenue' -import { graphqlFetch } from '#/graphql/client' -import type { venue } from '#/types/venue' + interface MyRouterContext { queryClient: QueryClient @@ -48,38 +45,6 @@ export const Route = createRootRouteWithContext()({ shellComponent: RootDocument, }) -const GET_VENUE = ` - query GetVenues { - venue { - id - name - address - city { - id - name - } - openingHours { - days - opening - closing - } - } - } -` - -function VenueLoader() { - const { data, isPending, isError } = useQuery({ - queryKey: ['venues'], - queryFn: () => graphqlFetch<{ venue: venue[] }>(GET_VENUE), - }) - - if (isPending) return

Loading venue…

- if (isError) return
error
- // Hardcoded: show first venue for now - if (data.venue.length == 0) return
No venues found
- const first = data.venue[0] - return -} function RootDocument({ children }: { children: React.ReactNode }) { return ( @@ -94,10 +59,10 @@ function RootDocument({ children }: { children: React.ReactNode }) { /> - +
{children} - +