diff --git a/website/src/components/SidebarAd/index.js b/website/src/components/SidebarAd/index.js index 56f3373d..83a150d5 100644 --- a/website/src/components/SidebarAd/index.js +++ b/website/src/components/SidebarAd/index.js @@ -1,5 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import BrowserOnly from '@docusaurus/BrowserOnly'; import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; import clsx from 'clsx'; @@ -17,35 +18,45 @@ export default React.memo(function SidebarAd() { const backgroundClass = BACKGROUNDS[Math.floor(Math.random() * BACKGROUNDS.length)]; - return Math.random() > 0.5 ? ( - { - window.gtag('event', 'moonchaser.sidebar.click'); - }}> -

- Get paid more. Receive risk-free salary negotiation - help from Moonchaser. You pay nothing unless your offer is increased. -

-
- ) : ( - { - window.gtag('event', 'levelsfyi.sidebar.click'); - }}> -

- Get paid, not played. Chat with former tech recruiters - who'll guide you on exactly what to say to negotiate a higher offer. -

-
+ // Because the SSR and client output can differ and hydration doesn't patch attribute differences, + // we'll render this on the browser only. + return ( + + {() => + Math.random() ? ( + { + window.gtag('event', 'moonchaser.sidebar.click'); + }}> +

+ Get paid more. Receive risk-free salary + negotiation help from Moonchaser. You pay nothing unless your + offer is increased. +

+
+ ) : ( + { + window.gtag('event', 'levelsfyi.sidebar.click'); + }}> +

+ Get paid, not played. Chat with former tech + recruiters who'll guide you on exactly what to say to negotiate a + higher offer. +

+
+ ) + } +
); }); diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 89e28b14..f598df86 100755 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -2,6 +2,7 @@ import React from 'react'; import classnames from 'classnames'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; +import BrowserOnly from '@docusaurus/BrowserOnly'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; @@ -53,66 +54,78 @@ function Home() {
-
-
-
-
-
- {Math.random() > 0.5 ? ( -
-

- - Get paid more. Receive risk-free salary negotiation - help from Moonchaser. You pay nothing unless your - offer is increased. - -

- + {/* // Because the SSR and client output can differ and hydration doesn't patch attribute differences, + we'll render this on the browser only. */} + + {() => ( +
+
+
+
+
+ {Math.random() > 0.5 ? ( +
+

+ + Get paid more. Receive risk-free salary + negotiation help from Moonchaser. You pay nothing + unless your offer is increased. + +

+ +
+ ) : ( +
+

+ + Get paid, not played. Chat with former tech + recruiters who'll guide you on exactly what to say + to negotiate a higher offer. + +

+ +
+ )}
- ) : ( -
-

- - Get paid, not played. Chat with former tech recruiters - who'll guide you on exactly what to say to negotiate a - higher offer. - -

- -
- )} +
-
-
+ )} +