website: use <ClientOnly> to prevent issues during SSR

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-18 23:41:20 +01:00
parent fe054136b1
commit d8841911de

View file

@ -2,6 +2,7 @@ import React from "react";
import clsx from "clsx";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import ClientOnly from "@docusaurus/core/lib/client/exports/ClientOnly.js";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl";
import styles from "./styles.module.css";
@ -102,6 +103,7 @@ function Home() {
<div className="row">
<div className="col col--5">
<div>
<ClientOnly>
<BeforeAfterSlider
className={styles.featureImage}
before={useBaseUrl("img/screen_apps_light.png")}
@ -109,6 +111,7 @@ function Home() {
width={640}
height={480}
/>
</ClientOnly>
</div>
</div>
<div className="col col--5 col--offset-2 padding-vert--xl">
@ -139,6 +142,7 @@ function Home() {
</div>
<div className="col col--5">
<div>
<ClientOnly>
<BeforeAfterSlider
className={styles.featureImage}
before={useBaseUrl("img/screen_admin_light.png")}
@ -146,6 +150,7 @@ function Home() {
width={640}
height={480}
/>
</ClientOnly>
</div>
</div>
</div>