-
-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (23 loc) · 737 Bytes
/
index.js
File metadata and controls
25 lines (23 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import {useLocation} from '@docusaurus/router';
import Content from '@theme-original/DocSidebar/Desktop/Content';
import AdsComponent from "@site/src/components/AdsComponent";
function SidebarAd() {
return (
// eslint-disable-next-line @docusaurus/no-untranslated-text
<div style={{border: 'solid thin gray', padding: 10, textAlign: 'center', marginTop: 10}}>
<AdsComponent />
</div>
);
}
export default function ContentWrapper(props) {
const {pathname} = useLocation();
const shouldShowSidebarAd = pathname.includes('/');
return (
<>
{/* {shouldShowSidebarAd && <SidebarAd />} */}
<Content {...props} />
{shouldShowSidebarAd && <SidebarAd />}
</>
);
}