55 * LICENSE file in the root directory of this source tree.
66 */
77
8- import React from 'react' ;
8+ import React from 'react'
99
10- import Head from '@docusaurus/Head' ;
11- import isInternalUrl from '@docusaurus/isInternalUrl' ;
12- import useDocusaurusContext from '@docusaurus/useDocusaurusContext' ;
13- import useBaseUrl from '@docusaurus/useBaseUrl' ;
14- import DocPaginator from '@theme/DocPaginator' ;
15- import useTOCHighlight from '@theme/hooks/useTOCHighlight' ;
10+ import Head from '@docusaurus/Head'
11+ import isInternalUrl from '@docusaurus/isInternalUrl'
12+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
13+ import useBaseUrl from '@docusaurus/useBaseUrl'
14+ import DocPaginator from '@theme/DocPaginator'
15+ import useTOCHighlight from '@theme/hooks/useTOCHighlight'
1616
17- import classnames from 'classnames' ;
18- import styles from './styles.module.css' ;
17+ import classnames from 'classnames'
18+ import styles from './styles.module.css'
1919
20- const LINK_CLASS_NAME = 'contents__link' ;
21- const ACTIVE_LINK_CLASS_NAME = 'contents__link--active' ;
22- const TOP_OFFSET = 100 ;
20+ const LINK_CLASS_NAME = 'contents__link'
21+ const ACTIVE_LINK_CLASS_NAME = 'contents__link--active'
22+ const TOP_OFFSET = 100
2323
24- function DocTOC ( { headings} ) {
25- useTOCHighlight ( LINK_CLASS_NAME , ACTIVE_LINK_CLASS_NAME , TOP_OFFSET ) ;
24+ function DocTOC ( { headings } ) {
25+ useTOCHighlight ( LINK_CLASS_NAME , ACTIVE_LINK_CLASS_NAME , TOP_OFFSET )
2626 return (
2727 < div className = "col col--3" >
2828 < div className = { styles . tableOfContents } >
2929 < Headings headings = { headings } />
3030 </ div >
3131 </ div >
32- ) ;
32+ )
3333}
3434
35- /* eslint-disable jsx-a11y/control-has-associated-label */
36- function Headings ( { headings, isChild} ) {
35+ function Headings ( { headings, isChild } ) {
3736 if ( ! headings . length ) {
38- return null ;
37+ return null
3938 }
4039 return (
4140 < ul className = { isChild ? '' : 'contents contents__left-border' } >
@@ -44,20 +43,21 @@ function Headings({headings, isChild}) {
4443 < a
4544 href = { `#${ heading . id } ` }
4645 className = { LINK_CLASS_NAME + `${ isChild ? ' link__child' : ' link__parent' } ` }
47- dangerouslySetInnerHTML = { { __html : heading . value } }
46+ dangerouslySetInnerHTML = { { __html : heading . value } }
4847 />
4948 < Headings isChild headings = { heading . children } />
5049 </ li >
5150 ) ) }
5251 </ ul >
53- ) ;
52+ )
5453}
5554
55+ /* eslint-disable camelcase */
5656function DocItem ( props ) {
57- const { siteConfig = { } } = useDocusaurusContext ( ) ;
58- const { url : siteUrl , title : siteTitle } = siteConfig ;
59- const { content : DocContent } = props ;
60- const { metadata} = DocContent ;
57+ const { siteConfig = { } } = useDocusaurusContext ( )
58+ const { url : siteUrl , title : siteTitle } = siteConfig
59+ const { content : DocContent } = props
60+ const { metadata } = DocContent
6161 const {
6262 description,
6363 title,
@@ -66,23 +66,23 @@ function DocItem(props) {
6666 lastUpdatedAt,
6767 lastUpdatedBy,
6868 sidebar_label
69- } = metadata ;
69+ } = metadata
7070 const {
7171 frontMatter : {
7272 image : metaImage ,
7373 keywords,
7474 hide_title : hideTitle ,
7575 hide_table_of_contents : hideTableOfContents ,
7676 } ,
77- } = DocContent ;
77+ } = DocContent
7878
79- let label = title . split ( "/" ) [ 0 ] . toUpperCase ( ) ;
80- let docsTitle = sidebar_label || title ;
79+ const label = title . split ( "/" ) [ 0 ] . toUpperCase ( )
80+ const docsTitle = sidebar_label || title
8181
82- const metaTitle = docsTitle ? `${ docsTitle } | ${ siteTitle } ` : siteTitle ;
83- let metaImageUrl = siteUrl + useBaseUrl ( metaImage ) ;
82+ const metaTitle = docsTitle ? `${ docsTitle } | ${ siteTitle } ` : siteTitle
83+ let metaImageUrl = siteUrl + useBaseUrl ( metaImage )
8484 if ( ! isInternalUrl ( metaImage ) ) {
85- metaImageUrl = metaImage ;
85+ metaImageUrl = metaImage
8686 }
8787
8888 return (
@@ -201,7 +201,7 @@ function DocItem(props) {
201201 </ div >
202202 </ div >
203203 </ >
204- ) ;
204+ )
205205}
206206
207- export default DocItem ;
207+ export default DocItem
0 commit comments