init
This commit is contained in:
commit
609483c43b
67 files changed
+8380
No files matched your search
+58
@@ -0,0 +1,58 @@
|
||||
import { Header } from './components/Header';
|
||||
import { HomePage } from './components/HomePage';
|
||||
import { DocumentationPage } from './components/DocumentationPage';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function App() {
|
||||
const [currentPage, setCurrentPage] = useState<'home' | 'documentation'>('home');
|
||||
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
|
||||
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
||||
|
||||
const toggleSidebar = () => {
|
||||
setIsSidebarOpen(!isSidebarOpen);
|
||||
};
|
||||
|
||||
const toggleTheme = () => {
|
||||
setTheme(theme === 'light' ? 'dark' : 'light');
|
||||
};
|
||||
|
||||
const navigateToHome = () => {
|
||||
setCurrentPage('home');
|
||||
setIsSidebarOpen(false);
|
||||
};
|
||||
|
||||
const navigateToDocumentation = () => {
|
||||
setCurrentPage('documentation');
|
||||
setIsSidebarOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`min-h-screen ${theme === 'dark' ? 'bg-[#1a1a1a] text-white' : 'bg-white text-gray-900'}`}>
|
||||
<Header
|
||||
toggleSidebar={toggleSidebar}
|
||||
theme={theme}
|
||||
toggleTheme={toggleTheme}
|
||||
navigateToHome={navigateToHome}
|
||||
navigateToDocumentation={navigateToDocumentation}
|
||||
/>
|
||||
|
||||
{currentPage === 'home' ? (
|
||||
<HomePage theme={theme} navigateToDocumentation={navigateToDocumentation} />
|
||||
) : (
|
||||
<DocumentationPage
|
||||
isSidebarOpen={isSidebarOpen}
|
||||
toggleSidebar={toggleSidebar}
|
||||
theme={theme}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Mobile overlay */}
|
||||
{isSidebarOpen && currentPage === 'documentation' && (
|
||||
<div
|
||||
className="fixed inset-0 bg-black bg-opacity-50 z-30 lg:hidden"
|
||||
onClick={toggleSidebar}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user