Skip to content

Commit 22a4a11

Browse files
authored
docs: remove carbon developer ads widget from docs sidebar (#13286)
1 parent c8cd9b1 commit 22a4a11

2 files changed

Lines changed: 11 additions & 51 deletions

File tree

docs/components/Footer/index.tsx

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,25 @@
1-
import { useEffect } from "react"
2-
import { useRouter } from "next/router"
3-
import cx from "classnames"
1+
import { useEffect } from "react";
2+
import cx from "classnames";
43

54
function kFormatter(num: number) {
6-
return (Math.sign(num) * (Math.abs(num) / 1000)).toFixed(1) + "k"
5+
return (Math.sign(num) * (Math.abs(num) / 1000)).toFixed(1) + "k";
76
}
87

98
export function Footer({ className = "" }) {
10-
const router = useRouter()
11-
129
useEffect(() => {
1310
fetch("https://api.github.com/repos/nextauthjs/next-auth")
1411
.then((res) => res.json())
1512
.then((data) => {
16-
const githubStat = document.querySelector(".github-counter")!
17-
if (!githubStat) return
18-
githubStat.innerHTML = kFormatter(data.stargazers_count ?? 21100)
19-
})
20-
21-
// CarbonAds hydration error workaround hack
22-
const carbonAdsEl =
23-
document.querySelector<HTMLScriptElement>("#_carbonads_js")
24-
if (carbonAdsEl) {
25-
carbonAdsEl.src =
26-
"https://cdn.carbonads.com/carbon.js?serve=CWYD42JY&placement=authjsdev&format=cover"
27-
28-
router.events.on("routeChangeComplete", () => {
29-
window._carbonads?.refresh()
30-
})
31-
}
32-
}, [])
13+
const githubStat = document.querySelector(".github-counter")!;
14+
if (!githubStat) return;
15+
githubStat.innerHTML = kFormatter(data.stargazers_count ?? 21100);
16+
});
17+
}, []);
3318
return (
3419
<div
3520
className={cx(
3621
"mx-auto flex w-full flex-col items-center gap-4 px-12 pb-20 pt-24 text-gray-600 sm:gap-12 dark:text-gray-100",
37-
className
22+
className,
3823
)}
3924
>
4025
<div className="flex w-full max-w-[90rem] flex-col justify-between gap-6 sm:flex-row sm:gap-0">
@@ -90,7 +75,7 @@ export function Footer({ className = "" }) {
9075
Auth.js &copy; Better Auth Inc. - {new Date().getFullYear()}
9176
</div>
9277
</div>
93-
)
78+
);
9479
}
9580

96-
export default Footer
81+
export default Footer;

docs/pages/global.css

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,6 @@ html[data-theme="dark"] .github-counter {
199199
animation: fadeOut 250ms ease-in;
200200
}
201201

202-
#carbonads_bak {
203-
@apply flex flex-col gap-1 rounded-md bg-neutral-100 p-3 text-xs text-neutral-500 dark:bg-neutral-800 dark:!text-neutral-400;
204-
205-
.carbon-text {
206-
@apply dark:text-neutral-300;
207-
}
208-
209-
.carbon-poweredby {
210-
@apply dark:text-neutral-400;
211-
}
212-
213-
#carbon-responsive .carbon-img {
214-
flex: unset !important;
215-
}
216-
img {
217-
@apply w-full !max-w-full rounded-[0.25rem];
218-
}
219-
220-
#carbon-responsive .carbon-responsive-wrap {
221-
border: none !important;
222-
background-color: unset !important;
223-
padding: 0 !important;
224-
}
225-
}
226-
227202
.sponsoredBadge {
228203
display: inline-block;
229204
width: max-content;

0 commit comments

Comments
 (0)