diff --git a/website/src/components/CarbonAd/index.js b/website/src/components/CarbonAd/index.js deleted file mode 100644 index 7789c1e7..00000000 --- a/website/src/components/CarbonAd/index.js +++ /dev/null @@ -1,48 +0,0 @@ -import React, {useEffect, useRef} from 'react'; - -// Credits: https://github.com/tannerlinsley/react-query/blob/master/docs/src/components/CarbonAds.js -function buildScript(src, attrs = {}) { - if (typeof document !== 'undefined') { - const script = document.createElement('script'); - script.async = true; - script.defer = true; - script.src = src; - Object.keys(attrs).forEach((attr) => - script.setAttribute(attr, attrs[attr]), - ); - - return script; - } -} - -export default React.memo(() => { - const ref = useRef(); - - useEffect(() => { - const script = buildScript( - '//cdn.carbonads.com/carbon.js?serve=CEAI4537&placement=wwwtechinterviewhandbookorg', - { - type: 'text/javascript', - id: '_carbonads_js', - }, - ); - - ref.current.appendChild(script); - }, []); - - useEffect(() => { - const interval = setInterval(() => { - [...ref.current.children].forEach((child) => { - if (child && child.id && child.id.startsWith('carbonads_')) { - ref.current.removeChild(child); - } - }); - }, 100); - - return () => { - clearInterval(interval); - }; - }); - - return
; -}); diff --git a/website/src/css/custom.css b/website/src/css/custom.css index 385016a9..a2c4690a 100755 --- a/website/src/css/custom.css +++ b/website/src/css/custom.css @@ -164,70 +164,3 @@ html[data-theme='dark'] .navbar-icon-telegram:before { width: 24px; } -#carbonads * { - margin: initial; - padding: initial; -} -#carbonads { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, - Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, - sans-serif; - display: flex; - background-color: hsl(0, 0%, 98%); - box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1); - z-index: 100; - margin: 1rem auto; -} -html[data-theme='dark'] #carbonads { - background-color: hsl(0, 0%, 15%); - box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.085), 0 0 2px hsl(0deg 0% 0% / 0.085), - 0 0 4px hsl(0deg 0% 0% / 0.085), 0 0 8px hsl(0deg 0% 0% / 0.085); -} -#carbonads a { - color: inherit; - text-decoration: none; -} -#carbonads a:hover { - color: inherit; -} -#carbonads span { - position: relative; - display: block; - overflow: hidden; -} -#carbonads .carbon-wrap { - display: flex; -} -#carbonads .carbon-img { - display: block; - margin: 0; - line-height: 1; -} -#carbonads .carbon-img img { - display: block; -} -#carbonads .carbon-text { - font-size: 13px; - padding: 10px; - margin-bottom: 16px; - line-height: 1.5; - text-align: left; -} -#carbonads .carbon-poweredby { - display: block; - padding: 6px 8px; - background: #f1f1f2; - text-align: center; - text-transform: uppercase; - letter-spacing: 0.5px; - font-weight: 600; - font-size: 8px; - line-height: 1; - border-top-left-radius: 3px; - position: absolute; - bottom: 0; - right: 0; -} -html[data-theme='dark'] #carbonads .carbon-poweredby { - background: #1e2021; -} diff --git a/website/src/pages/index.js b/website/src/pages/index.js index a1a114a3..72c6e918 100755 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -8,7 +8,6 @@ import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; import successStories from '../data/successStories'; -import CarbonAd from '../components/CarbonAd'; const BLIND_75_URL = 'https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU'; @@ -112,7 +111,6 @@ function Home() { description={siteConfig.tagline}> - @@ -213,20 +211,6 @@ function WhatIsThisSection() { ); } -function CarbonAdSection() { - return ( -
-
-
-
- -
-
-
-
- ); -} - function MoonchaserSection() { // Because the SSR and client output can differ and hydration doesn't patch attribute differences, // we'll render this on the browser only. diff --git a/website/src/theme/TOC/index.js b/website/src/theme/TOC/index.js index ced0e805..e09db3e7 100644 --- a/website/src/theme/TOC/index.js +++ b/website/src/theme/TOC/index.js @@ -3,7 +3,6 @@ import clsx from 'clsx'; import TOCItems from '@theme/TOCItems'; import styles from './styles.module.css'; // Using a custom className import SidebarAd from '../../components/SidebarAd'; -import CarbonAd from '../../components/CarbonAd'; // This prevents TOC highlighting to highlight TOCInline/TOCCollapsible by mistake const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight'; @@ -15,42 +14,14 @@ function TOC({className, ...props}) {
+

+ Table of Contents +

-
- -
-
-
-
- Follow - - - -
-
-
); }