From 7eabd667ce923aba0e33e374231da771e81f6a8a Mon Sep 17 00:00:00 2001 From: Bert Hausmans Date: Thu, 21 May 2026 00:34:31 +0200 Subject: [PATCH] feat(frontend): lesson badges + marketplace nav link --- packages/frontend/src/components/Layout.tsx | 1 + .../frontend/src/components/LessonTree.tsx | 104 +++++++++--------- 2 files changed, 55 insertions(+), 50 deletions(-) diff --git a/packages/frontend/src/components/Layout.tsx b/packages/frontend/src/components/Layout.tsx index ed01196..2ba1005 100644 --- a/packages/frontend/src/components/Layout.tsx +++ b/packages/frontend/src/components/Layout.tsx @@ -6,6 +6,7 @@ import { UserMenu } from './UserMenu.js'; const navItems = [ { to: '/', label: 'Dashboard', end: true }, { to: '/admin', label: 'Lessen' }, + { to: '/marketplace', label: 'Marketplace πŸ›οΈ' }, { to: '/stats', label: 'Stats' }, ]; diff --git a/packages/frontend/src/components/LessonTree.tsx b/packages/frontend/src/components/LessonTree.tsx index df4fd38..cce710e 100644 --- a/packages/frontend/src/components/LessonTree.tsx +++ b/packages/frontend/src/components/LessonTree.tsx @@ -3,9 +3,11 @@ import { Link } from 'react-router-dom'; import type { LessonTreeNode } from '@flashcard/shared'; import { lessonsApi } from '../api/lessons.js'; import { useLessons } from '../stores/lessonsStore.js'; +import { useAuth } from '../stores/authStore.js'; export function LessonTree({ nodes, depth = 0 }: { nodes: LessonTreeNode[]; depth?: number }) { const refresh = useLessons((s) => s.refresh); + const currentUserId = useAuth((s) => s.user?.id); const [addingTo, setAddingTo] = useState(null); const [name, setName] = useState(''); @@ -32,57 +34,59 @@ export function LessonTree({ nodes, depth = 0 }: { nodes: LessonTreeNode[]; dept return ( ); }