diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 442defafc..4ffd120f8 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -334,26 +334,16 @@ export const DocsNav = ({ }, [router.asPath]); const { resolvedTheme } = useTheme(); - const [learn_icon, setLearn_icon] = useState(''); - const [reference_icon, setReference_icon] = useState(''); - const [spec_icon, setSpec_icon] = useState(''); - const [overview_icon, setOverview_icon] = useState(''); - const [guides_icon, setGuides_icon] = useState(''); + const [mounted, setMounted] = useState(false); useEffect(() => { - if (resolvedTheme === 'dark') { - setOverview_icon('/icons/eye-dark.svg'); - setLearn_icon('/icons/compass-dark.svg'); - setReference_icon('/icons/book-dark.svg'); - setSpec_icon('/icons/clipboard-dark.svg'); - setGuides_icon('/icons/grad-cap-dark.svg'); - } else { - setOverview_icon('/icons/eye.svg'); - setLearn_icon('/icons/compass.svg'); - setReference_icon('/icons/book.svg'); - setSpec_icon('/icons/clipboard.svg'); - setGuides_icon('/icons/grad-cap.svg'); - } - }, [resolvedTheme]); + setMounted(true); + }, []); + + const overview_icon = mounted && resolvedTheme === 'dark' ? '/icons/eye-dark.svg' : '/icons/eye.svg'; + const learn_icon = mounted && resolvedTheme === 'dark' ? '/icons/compass-dark.svg' : '/icons/compass.svg'; + const reference_icon = mounted && resolvedTheme === 'dark' ? '/icons/book-dark.svg' : '/icons/book.svg'; + const spec_icon = mounted && resolvedTheme === 'dark' ? '/icons/clipboard-dark.svg' : '/icons/clipboard.svg'; + const guides_icon = mounted && resolvedTheme === 'dark' ? '/icons/grad-cap-dark.svg' : '/icons/grad-cap.svg'; return ( {/* BlogPost Data */}
@@ -862,8 +860,7 @@ const Home = (props: any) => { The Realtime Unified API
-for Accounting integrations + diff --git a/pages/md-style-guide.md b/pages/md-style-guide.md index 89dc4bddf..076256a3c 100644 --- a/pages/md-style-guide.md +++ b/pages/md-style-guide.md @@ -62,7 +62,7 @@ Use the following tags to give readers relevant information that is not part of To help readers find the information they are looking for within the document, add a table of contents at the beginning. ```markdown - + ``` ### Blockquote diff --git a/pages/specification-links.md b/pages/specification-links.md index d6ececa5b..eea6a99e4 100644 --- a/pages/specification-links.md +++ b/pages/specification-links.md @@ -13,7 +13,7 @@ next: You can find the latest released draft on the [Specification](../../specification) page. The complex numbering and naming system for drafts and meta-schemas is fully explained here as well. - + ## Understanding draft names and numbers