ban users from posting (#810)

This commit is contained in:
mantikoros 2022-08-28 00:23:25 -05:00 committed by GitHub
parent 2acc1a8433
commit 03e07037ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 0 deletions

View File

@ -44,6 +44,7 @@ export type User = {
currentBettingStreak?: number
hasSeenContractFollowModal?: boolean
freeMarketsCreated?: number
isBannedFromPosting?: boolean
}
export type PrivateUser = {

View File

@ -115,6 +115,8 @@ export function CreateAnswerPanel(props: { contract: FreeResponseContract }) {
const currentReturn = betAmount ? (currentPayout - betAmount) / betAmount : 0
const currentReturnPercent = (currentReturn * 100).toFixed() + '%'
if (user?.isBannedFromPosting) return <></>
return (
<Col className="gap-4 rounded">
<Col className="flex-1 gap-2">

View File

@ -18,6 +18,9 @@ export const CreateQuestionButton = (props: {
const { user, overrideText, className, query } = props
const router = useRouter()
if (user?.isBannedFromPosting) return <></>
return (
<div className={clsx('flex justify-center', className)}>
{user ? (

View File

@ -382,6 +382,8 @@ export function CommentInput(props: {
const isNumeric = contract.outcomeType === 'NUMERIC'
if (user?.isBannedFromPosting) return <></>
return (
<>
<Row className={'mb-2 gap-1 sm:gap-2'}>

View File

@ -76,6 +76,8 @@ export function CreateGroupButton(props: {
}
}
if (user.isBannedFromPosting) return <></>
return (
<ConfirmationButton
openModalBtn={{

View File

@ -67,6 +67,18 @@ export default function Create(props: { auth: { user: User } }) {
if (!router.isReady) return <div />
if (user.isBannedFromPosting)
return (
<Page>
<div className="mx-auto w-full max-w-2xl">
<div className="rounded-lg px-6 py-4 sm:py-0">
<Title className="!mt-0" text="Create a market" />
<p>Sorry, you are currently banned from creating a market.</p>
</div>
</div>
</Page>
)
return (
<Page>
<SEO