in src/theme/DocItem/Layout/index.tsx [43:93]
export default function DocItemLayout({ children }: Props): JSX.Element {
const docTOC = useDocTOC();
const { metadata } = useDoc();
const [isNew, setIsNew] = useState(true);
const [isZH, setIsZH] = useState(false);
useEffect(() => {
if (typeof window !== 'undefined') {
const notBanner = ['gettingStarted', 'benchmark', 'ecosystem', 'faq', 'releasenotes'];
const isShow = notBanner.some(item => location.pathname.includes(item));
setIsNew(location.pathname.includes('what-is-new'));
setIsZH(location.pathname.includes('zh-CN'));
}
}, [typeof window !== 'undefined' && location.pathname]);
return (
<div className="row">
<div className={clsx('col', !docTOC.hidden && styles.docItemCol)}>
<ContentVisibility metadata={metadata} />
<DocVersionBanner />
<div className={styles.docItemContainer}>
<article>
<DocBreadcrumbs />
{/* <DocVersionBadge /> */}
{docTOC.mobile}
<DocItemContent>{children}</DocItemContent>
<DocItemFooter />
</article>
<div className={`flex items-center text-sm lg:text-base justify-end lg:col mt-10`}>
{isNew ? (
<></>
) : (
<Link to={generateUrl(location.pathname)} className={`mr-6 ${styles.footerBtn}`}>
<DocsEdit /> <span className="ml-2">{isZH ? '编辑本页' : 'Edit this page'}</span>
</Link>
)}
<Link
to={`https://github.com/apache/doris-website/issues/new?title=Issue on docs&body=Path:${
typeof window !== 'undefined' && location.pathname
}`}
className={`lg:mr-6 ${styles.footerBtn}`}
>
<DocsAttention /> <span className="ml-2">{isZH ? '反馈问题' : 'Report issue'}</span>
</Link>
</div>
<DocItemPaginator />
</div>
</div>
{docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
</div>
);
}