File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React , { type ReactNode } from 'react' ;
2+ import clsx from 'clsx' ;
3+ import TOCItems from '@theme/TOCItems' ;
4+ import type { Props } from '@theme/TOC' ;
5+
6+ import styles from './styles.module.css' ;
7+
8+ // Using a custom className
9+ // This prevents TOCInline/TOCCollapsible getting highlighted by mistake
10+ const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight' ;
11+ const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active' ;
12+ import proAd from '../../images/pro-ad.png' ;
13+
14+ export default function TOC ( { className, ...props } : Props ) : ReactNode {
15+ return (
16+ < div className = { clsx ( styles . tableOfContents , 'thin-scrollbar' , className ) } >
17+ < TOCItems
18+ { ...props }
19+ linkClassName = { LINK_CLASS_NAME }
20+ linkActiveClassName = { LINK_ACTIVE_CLASS_NAME }
21+ />
22+ < div style = { {
23+ marginTop : '12px' ,
24+ } } >
25+ < a href = 'https://www.lxware.cn/halo-shop?code=mcYhwMkn' >
26+ < img src = { proAd } />
27+ </ a >
28+ </ div >
29+ </ div >
30+ ) ;
31+ }
Original file line number Diff line number Diff line change 1+ .tableOfContents {
2+ max-height : calc (100vh - (var (--ifm-navbar-height ) + 2rem ));
3+ overflow-y : auto;
4+ position : sticky;
5+ top : calc (var (--ifm-navbar-height ) + 1rem );
6+ }
7+
8+ @media (max-width : 996px ) {
9+ .tableOfContents {
10+ display : none;
11+ }
12+
13+ .docItemContainer {
14+ padding : 0 0.3rem ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments