diff --git a/apps/web/src/app/@nav/create/page.tsx b/apps/web/src/app/@nav/create/page.tsx
deleted file mode 100644
index 44b9715f..00000000
--- a/apps/web/src/app/@nav/create/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function CreateNav() {
- return null
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/default.tsx b/apps/web/src/app/@nav/default.tsx
deleted file mode 100644
index 867b896c..00000000
--- a/apps/web/src/app/@nav/default.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function DefaultNav() {
- return null // No navigation content for routes without specific @nav slots
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/games/matching/page.tsx b/apps/web/src/app/@nav/games/matching/page.tsx
deleted file mode 100644
index 9141cf32..00000000
--- a/apps/web/src/app/@nav/games/matching/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-export default function MatchingNav() {
- return (
-
- 🧩 Memory Pairs
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/games/memory-quiz/page.tsx b/apps/web/src/app/@nav/games/memory-quiz/page.tsx
deleted file mode 100644
index 19c76ad7..00000000
--- a/apps/web/src/app/@nav/games/memory-quiz/page.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-export default function MemoryQuizNav() {
- return (
-
- 🧠Memory Lightning
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/games/page.tsx b/apps/web/src/app/@nav/games/page.tsx
deleted file mode 100644
index bbdf8a2a..00000000
--- a/apps/web/src/app/@nav/games/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function GamesNav() {
- return null
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/guide/page.tsx b/apps/web/src/app/@nav/guide/page.tsx
deleted file mode 100644
index 32196175..00000000
--- a/apps/web/src/app/@nav/guide/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function GuideNav() {
- return null
-}
\ No newline at end of file
diff --git a/apps/web/src/app/@nav/page.tsx b/apps/web/src/app/@nav/page.tsx
deleted file mode 100644
index 9be08d2d..00000000
--- a/apps/web/src/app/@nav/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function HomeNav() {
- return null
-}
\ No newline at end of file
diff --git a/apps/web/src/app/games/matching/page.tsx b/apps/web/src/app/games/matching/page.tsx
index d32aa1a6..95e3805f 100644
--- a/apps/web/src/app/games/matching/page.tsx
+++ b/apps/web/src/app/games/matching/page.tsx
@@ -1,10 +1,13 @@
+import { PageWithNav } from '@/components/PageWithNav'
import { MemoryPairsProvider } from './context/MemoryPairsContext'
import { MemoryPairsGame } from './components/MemoryPairsGame'
export default function MatchingPage() {
return (
-
-
-
+
+
+
+
+
)
}
\ No newline at end of file
diff --git a/apps/web/src/app/games/memory-quiz/page.tsx b/apps/web/src/app/games/memory-quiz/page.tsx
index 379d57dc..b5abdc2b 100644
--- a/apps/web/src/app/games/memory-quiz/page.tsx
+++ b/apps/web/src/app/games/memory-quiz/page.tsx
@@ -6,7 +6,7 @@ import { css } from '../../../../styled-system/css'
import { AbacusReact } from '@soroban/abacus-react'
import { useAbacusConfig } from '@soroban/abacus-react'
import { isPrefix } from '../../../lib/memory-quiz-utils'
-import { StandardGameLayout } from '../../../components/StandardGameLayout'
+import { PageWithNav } from '@/components/PageWithNav'
interface QuizCard {
@@ -1733,7 +1733,7 @@ export default function MemoryQuizPage() {
}, [state.prefixAcceptanceTimeout])
return (
-
+
-
+
)
}
\ No newline at end of file
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 65ce7772..bee716e6 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -1,7 +1,6 @@
import type { Metadata, Viewport } from 'next'
import './globals.css'
import { ClientProviders } from '@/components/ClientProviders'
-import { AppNav } from '@/components/AppNav'
export const metadata: Metadata = {
title: 'Soroban Flashcard Generator',
@@ -17,16 +16,13 @@ export const viewport: Viewport = {
export default function RootLayout({
children,
- nav,
}: {
children: React.ReactNode
- nav: React.ReactNode
}) {
return (
- {nav}
{children}
diff --git a/apps/web/src/components/AppNav.tsx b/apps/web/src/components/AppNav.tsx
deleted file mode 100644
index fe059a02..00000000
--- a/apps/web/src/components/AppNav.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react'
-import { headers } from 'next/headers'
-import { AppNavBar } from './AppNavBar'
-
-interface AppNavProps {
- children: React.ReactNode
-}
-
-function getNavContentForPath(pathname: string): React.ReactNode {
- // Route-based nav content - no lazy loading needed
- if (pathname === '/games/matching' || pathname.startsWith('/arcade') && pathname.includes('matching')) {
- return (
-
- 🧩 Memory Pairs
-
- )
- }
-
- if (pathname === '/games/memory-quiz' || pathname.startsWith('/arcade') && pathname.includes('memory-quiz')) {
- return (
-
- 🧠Memory Lightning
-
- )
- }
-
- return null
-}
-
-export function AppNav({ children }: AppNavProps) {
- const headersList = headers()
- const pathname = headersList.get('x-pathname') || ''
-
- // Use @nav slot content if available, otherwise fall back to route-based detection
- const navContent = children || getNavContentForPath(pathname)
-
- return
-}
\ No newline at end of file
diff --git a/apps/web/src/components/PageWithNav.tsx b/apps/web/src/components/PageWithNav.tsx
new file mode 100644
index 00000000..23f3af89
--- /dev/null
+++ b/apps/web/src/components/PageWithNav.tsx
@@ -0,0 +1,33 @@
+'use client'
+
+import React from 'react'
+import { AppNavBar } from './AppNavBar'
+
+interface PageWithNavProps {
+ navTitle?: string
+ navEmoji?: string
+ children: React.ReactNode
+}
+
+export function PageWithNav({ navTitle, navEmoji, children }: PageWithNavProps) {
+ // Create nav content if title is provided
+ const navContent = navTitle ? (
+
+ {navEmoji && `${navEmoji} `}{navTitle}
+
+ ) : null
+
+ return (
+ <>
+
+ {children}
+ >
+ )
+}
\ No newline at end of file