Skip to content

Commit 12dbbb0

Browse files
committed
fix: cleanup css and padding for ads
1 parent 415e138 commit 12dbbb0

File tree

4 files changed

+35
-175
lines changed

4 files changed

+35
-175
lines changed

src/pages/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
padding: 20px 40px;
4343
}
4444
.Ad {
45-
min-height: 200px;
4645
padding: 20px 10px;
4746
min-width: 300px;
47+
border: 1px solid #e7e7e7;
4848
}
4949
.AdSec {
5050
margin-top: 20px;

src/theme/DocItem/index.tsx

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,29 @@ function DocItemContent(props: Props): JSX.Element {
8989
the added title is added under the same div.markdown block
9090
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
9191
*/}
92-
{shouldAddTitle && (
93-
<header>
94-
<Heading as="h1">{title}</Heading>
95-
</header>
96-
)}
92+
<header>
93+
<div className={styles.Ad}>
94+
<AdSense.Google
95+
client="ca-pub-7756182462259588"
96+
slot="5627199760"
97+
style={{ display: "block" }}
98+
format="auto"
99+
responsive="true"
100+
/>
101+
</div>
102+
{shouldAddTitle && <Heading as="h1">{title}</Heading>}
103+
</header>
97104
<MDXContent>
98-
<AdSense.Google
99-
client="ca-pub-7756182462259588"
100-
slot="4715974167"
101-
// slot="4169179252"
102-
style={{ display: "block" }}
103-
format="auto"
104-
responsive="true"
105-
/>
106-
<br />
107105
<DocContent />
108-
<AdSense.Google
109-
client="ca-pub-7756182462259588"
110-
slot="9213638280"
111-
style={{ display: "block" }}
112-
format="auto"
113-
responsive="true"
114-
/>
106+
<div className={styles.Ad}>
107+
<AdSense.Google
108+
client="ca-pub-7756182462259588"
109+
slot="3255885970"
110+
style={{ display: "block" }}
111+
format="auto"
112+
responsive="true"
113+
/>
114+
</div>
115115
</MDXContent>
116116
</div>
117117

@@ -121,9 +121,9 @@ function DocItemContent(props: Props): JSX.Element {
121121
<DocPaginator previous={metadata.previous} next={metadata.next} />
122122
</div>
123123
</div>
124-
{renderTocDesktop ? (
124+
{renderTocDesktop && (
125125
<div className="col col--3">
126-
<div style={{ minWidth: "300px" }}>
126+
<div className={styles.Ad}>
127127
<AdSense.Google
128128
client="ca-pub-7756182462259588"
129129
slot="4169179252"
@@ -132,24 +132,13 @@ function DocItemContent(props: Props): JSX.Element {
132132
responsive="true"
133133
/>
134134
</div>
135-
<br />
136135
<TOC
137136
toc={DocContent.toc}
138137
minHeadingLevel={tocMinHeadingLevel}
139138
maxHeadingLevel={tocMaxHeadingLevel}
140139
className={ThemeClassNames.docs.docTocDesktop}
141140
/>
142141
</div>
143-
) : (
144-
<div className="col col--3" style={{ minWidth: "300px" }}>
145-
<AdSense.Google
146-
client="ca-pub-7756182462259588"
147-
slot="4169179252"
148-
style={{ display: "block" }}
149-
format="auto"
150-
responsive="true"
151-
/>
152-
</div>
153142
)}
154143
</div>
155144
);

src/theme/DocItem/index__.js

Lines changed: 0 additions & 140 deletions
This file was deleted.

src/theme/DocItem/styles.module.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@
2020
display: none;
2121
}
2222
}
23+
24+
.Ad {
25+
padding: 20px 10px;
26+
min-width: 300px;
27+
border: 1px solid #e7e7e7;
28+
}
29+
@media screen and (max-width: 966px) {
30+
.Ad {
31+
margin-bottom: 20px;
32+
}
33+
}

0 commit comments

Comments
 (0)