From 7626345b60f83df4021d2e8d35c9a05c5b6af703 Mon Sep 17 00:00:00 2001 From: Niall Geoghegan Date: Mon, 29 Jul 2024 18:07:46 -0400 Subject: [PATCH] Make document page responsive for mobile tablet --- src/pages/Doc/single doc/index.jsx | 69 ++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/src/pages/Doc/single doc/index.jsx b/src/pages/Doc/single doc/index.jsx index 402cfde..fcfd418 100644 --- a/src/pages/Doc/single doc/index.jsx +++ b/src/pages/Doc/single doc/index.jsx @@ -30,6 +30,7 @@ const DocDetail = () => { const [error, setError] = useState(null); const [activeSection, setActiveSection] = useState(null); const [headings, setHeadings] = useState([]); + const [isTOCOpen, setIsTOCOpen] = useState(false); useEffect(() => { const fetchContent = async () => { @@ -38,7 +39,7 @@ const DocDetail = () => { if (!response.ok) { throw new Error(`Failed to fetch content: ${response.statusText}`); } - const text = await response.text(); // Ensure you're reading text + const text = await response.text(); setContent(text); } catch (error) { setError(error.message); @@ -83,29 +84,70 @@ const DocDetail = () => { if (loading) return
; if (error) return ; const headingToId = (children) => String(children).toLowerCase().replace(/\s+/g, '-'); + return (

{slug.replace(/_/g, ' ')}

-
-