.
This commit is contained in:
1 parent
04fccbb539
commit
214469eb31
31 files changed
+2345
-708
No files matched your search
+19
@@ -7,6 +7,8 @@ export default function App() {
|
||||
const [currentPage, setCurrentPage] = useState<'home' | 'documentation'>('home');
|
||||
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
|
||||
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
||||
const [currentTaxonomyId, setCurrentTaxonomyId] = useState<string | null>(null);
|
||||
const [currentArticleSlug, setCurrentArticleSlug] = useState<string | null>(null);
|
||||
|
||||
const toggleSidebar = () => {
|
||||
setIsSidebarOpen(!isSidebarOpen);
|
||||
@@ -19,6 +21,8 @@ export default function App() {
|
||||
const navigateToHome = () => {
|
||||
setCurrentPage('home');
|
||||
setIsSidebarOpen(false);
|
||||
setCurrentTaxonomyId(null);
|
||||
setCurrentArticleSlug(null);
|
||||
};
|
||||
|
||||
const navigateToDocumentation = () => {
|
||||
@@ -26,6 +30,17 @@ export default function App() {
|
||||
setIsSidebarOpen(false);
|
||||
};
|
||||
|
||||
const handleTaxonomyClick = (taxonomyId: string) => {
|
||||
setCurrentPage('documentation');
|
||||
setCurrentTaxonomyId(taxonomyId);
|
||||
setCurrentArticleSlug(null);
|
||||
setIsSidebarOpen(false);
|
||||
};
|
||||
|
||||
const handleArticleClick = (slug: string) => {
|
||||
setCurrentArticleSlug(slug);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`min-h-screen ${theme === 'dark' ? 'bg-[#1a1a1a] text-white' : 'bg-white text-gray-900'}`}>
|
||||
<Header
|
||||
@@ -34,6 +49,7 @@ export default function App() {
|
||||
toggleTheme={toggleTheme}
|
||||
navigateToHome={navigateToHome}
|
||||
navigateToDocumentation={navigateToDocumentation}
|
||||
onTaxonomyClick={handleTaxonomyClick}
|
||||
/>
|
||||
|
||||
{currentPage === 'home' ? (
|
||||
@@ -43,6 +59,9 @@ export default function App() {
|
||||
isSidebarOpen={isSidebarOpen}
|
||||
toggleSidebar={toggleSidebar}
|
||||
theme={theme}
|
||||
taxonomyId={currentTaxonomyId}
|
||||
articleSlug={currentArticleSlug}
|
||||
onArticleClick={handleArticleClick}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
Reference in new issue
Block a user