diff --git a/client/pages/post/[id].tsx b/client/pages/post/[id].tsx index e2e28048..5a99b977 100644 --- a/client/pages/post/[id].tsx +++ b/client/pages/post/[id].tsx @@ -1,8 +1,9 @@ import { Loading, Page, Text } from "@geist-ui/core"; import { useRouter } from "next/router"; -import { useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import Document from '../../components/document' import Header from "../../components/header"; +import UnauthenticatedHeader from "../../components/unauthenticated-header"; import VisibilityBadge from "../../components/visibility-badge"; import { ThemeProps } from "../_app"; @@ -42,12 +43,19 @@ const Post = ({ theme, changeTheme }: ThemeProps) => { } fetchPost() }, [router, router.query.id]) - console.log(post, isLoading, error) + const token = useCallback(() => { + if (typeof window !== "undefined") { + return localStorage.getItem("drift-token") + } else { + return "" + } + }, []) return ( -
+ {token() &&
} + {!token() && } {error && {error}}