Only RichardHanania can create questions

This commit is contained in:
James Grugett 2022-07-15 00:42:34 -05:00
parent a6f4a5fc22
commit 6a5fe931dd
3 changed files with 4 additions and 11 deletions

View File

@ -204,7 +204,9 @@ export default function Sidebar(props: { className?: string }) {
<nav aria-label="Sidebar" className={className}>
<ManifoldLogo className="py-6" twoLine />
{user?.username === 'RichardHanania' && (
<CreateQuestionButton user={user} />
)}
<Spacer h={4} />
{user && (
<div className="w-full" style={{ minHeight: 80 }}>

View File

@ -57,6 +57,7 @@ export default function Create() {
const creator = useUser()
useEffect(() => {
if (creator === null) router.push('/')
if (creator?.username !== 'RichardHanania') router.push('/')
}, [creator, router])
if (!router.isReady || !creator) return <div />

View File

@ -42,16 +42,6 @@ const Home = () => {
}}
/>
</Col>
<button
type="button"
className="fixed bottom-[70px] right-3 inline-flex items-center rounded-full border border-transparent bg-indigo-600 p-3 text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 lg:hidden"
onClick={() => {
router.push('/create')
track('mobile create button')
}}
>
<PlusSmIcon className="h-8 w-8" aria-hidden="true" />
</button>
</Page>
{contract && (