Whitelist SalemCenter as a market creator as well.

This commit is contained in:
James Grugett 2022-07-15 00:58:39 -05:00
parent c15292e2cb
commit 02aa13f7d1
4 changed files with 11 additions and 3 deletions

View File

@ -18,6 +18,7 @@ export type EnvConfig = {
faviconPath?: string // Should be a file in /public
navbarLogoPath?: string
newQuestionPlaceholders: string[]
whitelistCreators?: string[]
// Currency controls
fixedAnte?: number

View File

@ -20,4 +20,5 @@ export const SALEM_CENTER_CONFIG: EnvConfig = {
faviconPath: '/salem-center/logo.ico',
navbarLogoPath: '/salem-center/salem-center-logo.svg',
newQuestionPlaceholders: [],
whitelistCreators: ['RichardHanania', 'SalemCenter'],
}

View File

@ -19,7 +19,7 @@ import { MenuButton } from './menu'
import { ProfileSummary } from './profile-menu'
import NotificationsIcon from 'web/components/notifications-icon'
import React, { useEffect, useState } from 'react'
import { IS_PRIVATE_MANIFOLD } from 'common/envs/constants'
import { ENV_CONFIG, IS_PRIVATE_MANIFOLD } from 'common/envs/constants'
import { CreateQuestionButton } from 'web/components/create-question-button'
import { useMemberGroups } from 'web/hooks/use-group'
import { groupPath } from 'web/lib/firebase/groups'
@ -214,7 +214,7 @@ export default function Sidebar(props: { className?: string }) {
<nav aria-label="Sidebar" className={className}>
<ManifoldLogo className="py-6" twoLine />
{user?.username === 'RichardHanania' && (
{ENV_CONFIG.whitelistCreators?.includes(user?.username ?? '') && (
<CreateQuestionButton user={user} />
)}
<Spacer h={4} />

View File

@ -28,6 +28,7 @@ import { GroupSelector } from 'web/components/groups/group-selector'
import { User } from 'common/user'
import { TextEditor, useTextEditor } from 'web/components/editor'
import { Checkbox } from 'web/components/checkbox'
import { ENV_CONFIG } from 'common/envs/constants'
type NewQuestionParams = {
groupId?: string
@ -57,7 +58,12 @@ export default function Create() {
const creator = useUser()
useEffect(() => {
if (creator === null) router.push('/')
if (creator?.username !== 'RichardHanania') router.push('/')
if (
ENV_CONFIG.whitelistCreators &&
!ENV_CONFIG.whitelistCreators?.includes(creator?.username ?? '')
) {
router.push('/')
}
}, [creator, router])
if (!router.isReady || !creator) return <div />