@@ -17,7 +17,7 @@ import SupportDropdownMenu from '@site/src/components/Support/SupportDropdownMen
1717import styles from './styles.module.css' ;
1818
1919/**
20- * Decide if the toc should be rendered, on mobile or desktop viewports
20+ * Decide if the ToC should be rendered, on mobile or desktop viewports.
2121 */
2222function useDocTOC ( ) {
2323 const { frontMatter, toc} = useDoc ( ) ;
@@ -42,9 +42,9 @@ function useDocTOC() {
4242
4343export default function DocItemLayout ( { children} : Props ) : JSX . Element {
4444 const docTOC = useDocTOC ( ) ;
45- const { metadata, frontMatter} = useDoc ( ) ; // Get frontMatter to check for hide_table_of_contents
46- const hideTOC = frontMatter . hide_table_of_contents ; // Check if TOC is hidden
47- const windowSize = useWindowSize ( ) ; // Get current window size
45+ const { metadata, frontMatter} = useDoc ( ) ; // Get the front-matter metadata to check for the ` hide_table_of_contents` configuration.
46+ const hideTOC = frontMatter . hide_table_of_contents ; // Check if the ToC is hidden.
47+ const windowSize = useWindowSize ( ) ; // Get the current window size.
4848
4949 return (
5050 < div className = "row" >
@@ -55,7 +55,7 @@ export default function DocItemLayout({children}: Props): JSX.Element {
5555 < article >
5656 < DocBreadcrumbs />
5757 < DocVersionBadge />
58- { /* Show Support button on mobile */ }
58+ { /* Show the Support button on mobile. */ }
5959 { windowSize === 'mobile' && (
6060 < div style = { { display : 'flex' , justifyContent : 'left' , marginBottom : '1rem' } } >
6161 < SupportDropdownMenu />
@@ -69,16 +69,16 @@ export default function DocItemLayout({children}: Props): JSX.Element {
6969 </ div >
7070 </ div >
7171
72- { /* Ensure the right column always exists, even if there is no TOC */ }
72+ { /* Ensure the right column always exists, even if there is no ToC. */ }
7373 { ! hideTOC && windowSize !== 'mobile' && (
7474 < div className = "col col--3" style = { { position : "relative" } } >
75- { /* Add a wrapper div to make the support dropdown and TOC sticky */ }
75+ { /* Add a wrapper div to make the support dropdown and ToC sticky. */ }
7676 < div style = { { position : "sticky" , top : "80px" , zIndex : 1 } } >
77- { /* Add the support dropdown above the TOC on desktop */ }
77+ { /* Add the support dropdown above the ToC on desktop. */ }
7878 < div style = { { display : 'flex' , justifyContent : 'flex-start' , padding : '0px 17px' , right : '0' } } >
7979 < SupportDropdownMenu />
8080 </ div >
81- { /* Render TOC if available */ }
81+ { /* Render the ToC if one is available. */ }
8282 { docTOC . desktop }
8383 </ div >
8484 </ div >
0 commit comments