diff --git a/foomo/src/components/GoPlayground.tsx b/foomo/src/components/GoPlayground.tsx index 2a18efe..1b7ec00 100644 --- a/foomo/src/components/GoPlayground.tsx +++ b/foomo/src/components/GoPlayground.tsx @@ -18,7 +18,7 @@ import React, { useEffect, useState } from "react"; import { Iframe } from "./Iframe"; import { IsItCool } from "./IsItCool"; -import Highlight, { defaultProps } from "prism-react-renderer"; +import { Highlight, defaultProps } from "prism-react-renderer"; import Link from "@docusaurus/Link"; export const GoPlayground = (props: { id: string; proportion: number }) => { diff --git a/foomo/src/components/IsItCool.tsx b/foomo/src/components/IsItCool.tsx index efd1d70..ce74c70 100644 --- a/foomo/src/components/IsItCool.tsx +++ b/foomo/src/components/IsItCool.tsx @@ -15,11 +15,14 @@ export const IsItCool = (props: { topic: string; id: string; }) => { - const [isCool, setIsCool] = useState(getISCool(props.id)); + const [isCool, setIsCool] = useState(false); useEffect(() => { - console.log("well it is cool",props.id, {isCool, SSR}) - }, [isCool, SSR]); - if (!isCool) { + if (localStorage.getItem(props.id) === yes) { + setIsCool(true); + } + }, [props.id]); + + if (SSR || !isCool) { return (