From 80ea611ba8c64036a0ea1e41e3a05cb576291dbb Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 24 Jun 2022 12:00:21 -0500 Subject: [PATCH] Only RichardHanania can create markets --- web/components/nav/sidebar.tsx | 42 +++++++++++++++------------- web/pages/create.tsx | 1 + web/pages/group/[...slugs]/index.tsx | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 5716e5cd..5c667c27 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -305,27 +305,31 @@ export default function Sidebar(props: { className?: string }) { buttonContent={} /> - + {user?.username === 'RichardHanania' && ( +
+ - {user && - mustWaitForFreeMarketStatus != 'loading' && - mustWaitForFreeMarketStatus ? ( - - - Next free question in {countdown} - - - ) : ( - user && - mustWaitForFreeMarketStatus != 'loading' && - !mustWaitForFreeMarketStatus && ( - - - Daily free question - - ) + ) : ( + user && + mustWaitForFreeMarketStatus != 'loading' && + !mustWaitForFreeMarketStatus && ( + + + Daily free question + + + ) + )} +
)} ) diff --git a/web/pages/create.tsx b/web/pages/create.tsx index c032b2d0..d32976a4 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -73,6 +73,7 @@ export function NewContract(props: { question: string; groupId?: string }) { useEffect(() => { if (creator === null) router.push('/') + if (creator && creator.username !== 'RichardHanania') router.push('/') }, [creator]) const [outcomeType, setOutcomeType] = useState('BINARY') diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index 9ca1e1fa..8d7e5bf3 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -191,7 +191,7 @@ export default function GroupPage(props: { <span className={'text-gray-700'}>{group.about}</span> </div> - {isMember && ( + {isMember && user?.username === 'RichardHanania' && ( <CreateQuestionButton user={user} overrideText={'Add a new question'}