diff --git a/src/app/pages/Docs.tsx b/src/app/pages/Docs.tsx index decd5ad..7f6ec71 100644 --- a/src/app/pages/Docs.tsx +++ b/src/app/pages/Docs.tsx @@ -21,7 +21,8 @@ import { Code, Users, Layers, - ArrowLeft + ArrowLeft, + ArrowRight } from 'lucide-react'; import { useResponsive } from '../hooks/useResponsive'; import VspecLogo from '../components/VspecLogo'; @@ -700,8 +701,8 @@ function TreeItem({ node, level, activeDoc, setActiveDoc, expandedSections, togg )} ); -} - + } + export default function Docs() { const { isMobile, isTablet } = useResponsive(); const [activeProduct, setActiveProduct] = useState('vspec'); @@ -1034,72 +1035,62 @@ export default function Docs() { display: 'flex', minHeight: 'calc(100vh - 140px)', }}> - {/* ========== LEFT SIDEBAR ========== */} - - {(isSidebarOpen || !isMobile) && ( - - {isMobile && ( - - )} - - - - )} - + {/* ========== LEFT SIDEBAR WITH IMPROVED MOBILE ========== */} + {isMobile && isSidebarOpen && ( +
setIsSidebarOpen(false)} + style={{ + position: 'fixed', + inset: 0, + background: 'rgba(0, 0, 0, 0.7)', + backdropFilter: 'blur(4px)', + WebkitBackdropFilter: 'blur(4px)', + zIndex: 100, + }} + /> + )} + + {/* LEFT SIDEBAR - Navigation */} + - {/* ========== MAIN CONTENT ========== */} + {/* MAIN CONTENT AREA */}
- {/* Dynamic content based on activeDoc */} {(() => { const currentDoc = docContent[activeDoc]; @@ -1115,48 +1106,77 @@ export default function Docs() { return ( <> - {/* Breadcrumb */} -
- VSPEC Documentation + e.currentTarget.style.color = colors.accent} + onMouseLeave={(e) => e.currentTarget.style.color = colors.textMuted} + > + Documentation + {currentDoc.breadcrumb.map((crumb, idx) => ( - - - {crumb} + + + + {crumb} + ))} -
+ - {/* Page Title */} + {/* Page Title - GitBook Style */}

{currentDoc.title}

+ + {/* Optional subtitle/description */} + {currentDoc.description && ( +

+ {currentDoc.description} +

+ )} - {/* Sections */} + {/* Sections - GitBook Style */} {currentDoc.sections.map((section, idx) => ( -
+
{section.title && (

@@ -1166,49 +1186,65 @@ export default function Docs() { {section.code && (
- {section.code} +
+                          {section.code}
+                        
)} {section.content && (

{section.content}

@@ -1217,64 +1253,83 @@ export default function Docs() { {section.list && (
    {section.list.map((item, listIdx) => ( -
  • {item}
  • +
  • {item}
  • ))}
)}

))} - {/* Quick Links for Introduction page */} + {/* Quick Links for Introduction page - GitBook Style */} {activeDoc === 'introduction' && ( -
+

- Get Started + Next Steps

{/* Quick Start - navigates to dashboard */} +
+ +

Quick Start

Jump into your dashboard now @@ -1357,15 +1412,17 @@ export default function Docs() { })()}

- {/* ========== RIGHT SIDEBAR (TOC - Dynamic) ========== */} + {/* RIGHT SIDEBAR - Table of Contents (GitBook Style) */} {!isMobile && !isTablet && (
+ {/* Search Input */} +
+ + setSearchQuery(e.target.value)} + autoFocus + style={{ + flex: 1, + background: 'transparent', + border: 'none', + outline: 'none', + fontSize: '16px', + color: colors.text, + fontFamily: 'var(--font-sans)', + }} + /> + +
- {/* Search Results */} -
- {searchQuery.trim() === '' ? ( -
- Type to search documentation... -
- ) : ( - <> - {/* Filter matching docs */} - {Object.entries(docContent) - .filter(([_, doc]) => + {/* Search Results */} +
+ {searchQuery.trim() === '' ? ( +
+ Type to search documentation... +
+ ) : ( + <> + {/* Filter matching docs */} + {Object.entries(docContent) + .filter(([_, doc]) => + doc.title.toLowerCase().includes(searchQuery.toLowerCase()) || + doc.sections.some(s => + s.content?.toLowerCase().includes(searchQuery.toLowerCase()) || + s.title?.toLowerCase().includes(searchQuery.toLowerCase()) + ) + ) + .map(([docId, doc]) => ( + + )) + } + + {/* No results message */} + {Object.entries(docContent).filter(([_, doc]) => doc.title.toLowerCase().includes(searchQuery.toLowerCase()) || doc.sections.some(s => s.content?.toLowerCase().includes(searchQuery.toLowerCase()) || s.title?.toLowerCase().includes(searchQuery.toLowerCase()) ) - ) - .map(([docId, doc]) => ( - - )) - } - - {/* No results message */} - {Object.entries(docContent).filter(([_, doc]) => - doc.title.toLowerCase().includes(searchQuery.toLowerCase()) || - doc.sections.some(s => - s.content?.toLowerCase().includes(searchQuery.toLowerCase()) || - s.title?.toLowerCase().includes(searchQuery.toLowerCase()) - ) - ).length === 0 && ( -
- No results found for "{searchQuery}" -
- )} - - )} + ).length === 0 && ( +
+ No results found for "{searchQuery}" +
+ )} + + )}