From 52addd2eb3586c250b790225f42de478aa541e28 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 10 Dec 2021 18:19:35 -0600 Subject: [PATCH] show content only with ?demo --- web/components/header.tsx | 62 ++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/web/components/header.tsx b/web/components/header.tsx index a1f02426..7b520304 100644 --- a/web/components/header.tsx +++ b/web/components/header.tsx @@ -1,6 +1,9 @@ +import { useEffect, useState } from 'react' import clsx from 'clsx' -import { Popover } from '@headlessui/react' +import Image from 'next/image' import Link from 'next/link' +import { Popover } from '@headlessui/react' + import { useUser } from '../hooks/use-user' import { firebaseLogin } from '../lib/firebase/users' @@ -9,7 +12,7 @@ const navigation = [ name: 'About', href: 'https://mantic.notion.site/About-Mantic-Markets-46a1a0fb6e294011a8b6b582e276359f', }, - { name: 'Simulator', href: '/simulator' }, + // { name: 'Simulator', href: '/simulator' }, ] function SignInLink(props: { darkBackground?: boolean }) { @@ -21,30 +24,42 @@ function SignInLink(props: { darkBackground?: boolean }) { ? 'text-white hover:text-gray-300' : 'hover:text-gray-500' + + + const [showLogin, setShowLogin] = useState(false) + useEffect(() => { + setShowLogin(location.search.includes('demo')) + }, []) + return ( <> - {user ? ( - <> - - - Create a market - - + {user + ? ( + <> + + + Create a market + + - - - {user.name} - - - - ) : ( - - )} + + + {user.name} + + + + ) + + : showLogin + ? + + : <> + } ) } @@ -96,6 +111,7 @@ export function Header(props: { darkBackground?: boolean }) { ))} +