diff --git a/src/App.tsx b/src/App.tsx index 2cacbef9..9e2cc50c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,6 +22,8 @@ import MarkdownEditor from "./pages/MarkdownEditor"; import Cursortrail from "./Cursortrail"; import { HistoryProvider } from "./contexts/HistoryContext"; +import TypingSvgGeneratorPage from "./pages/TypingSvgGeneratorPage"; + const queryClient = new QueryClient(); // Placeholder components for missing routes to prevent app crash @@ -59,7 +61,8 @@ export default function App() { } /> } /> } /> - + + } /> } /> } /> @@ -77,4 +80,4 @@ export default function App() { ); -}; \ No newline at end of file +}; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 065bd333..f3e42116 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,13 +1,33 @@ import { cn } from '@/lib/utils'; import { sidebarCategories } from "../data/sidebarCategories"; +import { useNavigate } from 'react-router-dom'; interface SidebarProps { selectedCategory: string; onCategorySelect: (category: string) => void; } +const categoryPaths: Record = { + home: '/', + elements: '/elements', + templates: '/templates', + projects: '/projects', + about: '/about', + 'readme-editor': '/readme-editor', + 'markdown-editor': '/markdown-editor', + 'ai-editor': '/ai-editor-intro', + 'typing-svg': '/typing-svg', +}; + +const Sidebar = ({ selectedCategory, onCategorySelect }: SidebarProps) => { +const navigate = useNavigate(); -const Sidebar = ({ selectedCategory, onCategorySelect }: SidebarProps) => { + const handleCategoryClick = (categoryId: string) => { + onCategorySelect(categoryId); + const path = categoryPaths[categoryId] || '/'; + navigate(path); + }; + return (