From 547728b6ec793c83eeeddfe08a0e312483515039 Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Sun, 7 Dec 2025 19:47:16 -0800 Subject: [PATCH] only show navbar in video app --- frontend/src/App.tsx | 12 +++++++-- frontend/src/components/Navbar/Navbar.tsx | 11 ++++++-- frontend/src/config/apps.ts | 32 +++++++++++++++++++++++ frontend/src/pages/LandingPage.tsx | 31 ++-------------------- 4 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 frontend/src/config/apps.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0f16462..ff422a3 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,9 +4,9 @@ import { ErrorBoundary } from './components/ErrorBoundary'; import { Navbar } from './components/Navbar/Navbar'; import { ProtectedRoute } from './components/ProtectedRoute'; import { LandingPage } from './pages/LandingPage'; -import { VideoApp } from './pages/VideoApp'; import { AdminPage } from './pages/AdminPage'; import { LoginPage } from './pages/LoginPage'; +import { APPS } from './config/apps'; import './App.css'; function App() { @@ -19,7 +19,15 @@ function App() {
} /> - } /> + {/* Dynamically generate routes for enabled apps */} + {APPS.filter(app => !app.disabled).map(app => ( + } + /> + ))} + {/* Keep non-app routes separate */} } /> { + return APPS.find(app => pathname === app.link || pathname.startsWith(app.link + '/')); + }; + + const currentApp = getCurrentApp(location.pathname); + const isVideoApp = currentApp?.id === 'videos'; const [searchInput, setSearchInput] = useState(searchParams.get('search') || ''); // Sync search input with URL params @@ -92,7 +99,7 @@ export function Navbar() { - {isVideoPage && ( + {isVideoApp && (
diff --git a/frontend/src/config/apps.ts b/frontend/src/config/apps.ts new file mode 100644 index 0000000..57d6324 --- /dev/null +++ b/frontend/src/config/apps.ts @@ -0,0 +1,32 @@ +import React from 'react'; +import { VideoApp } from '../pages/VideoApp'; + +export type App = { + id: string; + name: string; + description: string; + cta: string; + link: string; +} & ( + | { disabled: true; component?: never } + | { disabled?: false; component: React.ComponentType } +); + +export const APPS: App[] = [ + { + id: 'videos', + name: 'Video Library', + description: 'Browse long-form videos from your trusted kid-friendly channels, already filtered to longer than ten minutes.', + cta: 'Open Videos', + link: '/videos', + component: VideoApp + }, + { + id: 'storytime', + name: 'Story Time (Coming Soon)', + description: 'Narrated stories and audio adventures for quiet time.', + cta: 'In Development', + link: '/stories', + disabled: true + } +]; diff --git a/frontend/src/pages/LandingPage.tsx b/frontend/src/pages/LandingPage.tsx index 091ead6..8fe60fa 100644 --- a/frontend/src/pages/LandingPage.tsx +++ b/frontend/src/pages/LandingPage.tsx @@ -1,40 +1,13 @@ import { Link } from 'react-router-dom'; +import { APPS } from '../config/apps'; import './LandingPage.css'; -type App = { - id: string; - name: string; - description: string; - cta: string; -} & ( - | { disabled: true; link?: never } - | { disabled?: false; link: string } -); - -const APPS: App[] = [ - { - id: 'videos', - name: 'Video Library', - description: 'Browse long-form videos from your trusted kid-friendly channels, already filtered to longer than ten minutes.', - cta: 'Open Videos', - link: '/videos' - }, - { - id: 'soon', - name: 'Story Time (Coming Soon)', - description: 'Narrated stories and audio adventures for quiet time.', - cta: 'In Development', - disabled: true - } -]; - export function LandingPage() { return (
-

Choose an experience

Welcome to Kiddos

-

Select an app below to get started. We’ll keep adding more experiences over time.

+

Select an app below to get started.