Skip to content

Commit 22e789e

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

File tree

4 files changed

+45
-171
lines changed

4 files changed

+45
-171
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: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,43 @@ 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 && (
92+
{shouldAddTitle ? (
9393
<header>
94+
<div className={styles.Ad}>
95+
<AdSense.Google
96+
client="ca-pub-7756182462259588"
97+
slot="5627199760"
98+
style={{ display: "block" }}
99+
format="auto"
100+
responsive="true"
101+
/>
102+
</div>
94103
<Heading as="h1">{title}</Heading>
95104
</header>
105+
) : (
106+
<header>
107+
<div className={styles.Ad}>
108+
<AdSense.Google
109+
client="ca-pub-7756182462259588"
110+
slot="5627199760"
111+
style={{ display: "block" }}
112+
format="auto"
113+
responsive="true"
114+
/>
115+
</div>
116+
</header>
96117
)}
97118
<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 />
107119
<DocContent />
108-
<AdSense.Google
109-
client="ca-pub-7756182462259588"
110-
slot="9213638280"
111-
style={{ display: "block" }}
112-
format="auto"
113-
responsive="true"
114-
/>
120+
<div className={styles.Ad}>
121+
<AdSense.Google
122+
client="ca-pub-7756182462259588"
123+
slot="3255885970"
124+
style={{ display: "block" }}
125+
format="auto"
126+
responsive="true"
127+
/>
128+
</div>
115129
</MDXContent>
116130
</div>
117131

@@ -121,9 +135,9 @@ function DocItemContent(props: Props): JSX.Element {
121135
<DocPaginator previous={metadata.previous} next={metadata.next} />
122136
</div>
123137
</div>
124-
{renderTocDesktop ? (
138+
{renderTocDesktop && (
125139
<div className="col col--3">
126-
<div style={{ minWidth: "300px" }}>
140+
<div className={styles.Ad}>
127141
<AdSense.Google
128142
client="ca-pub-7756182462259588"
129143
slot="4169179252"
@@ -132,24 +146,13 @@ function DocItemContent(props: Props): JSX.Element {
132146
responsive="true"
133147
/>
134148
</div>
135-
<br />
136149
<TOC
137150
toc={DocContent.toc}
138151
minHeadingLevel={tocMinHeadingLevel}
139152
maxHeadingLevel={tocMaxHeadingLevel}
140153
className={ThemeClassNames.docs.docTocDesktop}
141154
/>
142155
</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>
153156
)}
154157
</div>
155158
);

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)