From 367046a6e03f79819c5df3e606243d339265c221 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 7 Aug 2022 16:04:50 -0700 Subject: [PATCH] Only show liquidity panel to Hanania --- web/components/contract/contract-info-dialog.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/components/contract/contract-info-dialog.tsx b/web/components/contract/contract-info-dialog.tsx index 168ada50..9cb28744 100644 --- a/web/components/contract/contract-info-dialog.tsx +++ b/web/components/contract/contract-info-dialog.tsx @@ -13,6 +13,8 @@ import { Col } from '../layout/col' import { Modal } from '../layout/modal' import { Title } from '../title' import { InfoTooltip } from '../info-tooltip' +import { useUser } from 'web/hooks/use-user' +import { ENV_CONFIG } from 'common/envs/constants' export const contractDetailsButtonClassName = 'group flex items-center rounded-md px-3 py-2 text-sm font-medium cursor-pointer hover:bg-gray-100 text-gray-400 hover:text-gray-500' @@ -20,6 +22,8 @@ export const contractDetailsButtonClassName = export function ContractInfoDialog(props: { contract: Contract; bets: Bet[] }) { const { contract, bets } = props + const user = useUser() + const [open, setOpen] = useState(false) const formatTime = (dt: number) => dayjs(dt).format('MMM DD, YYYY hh:mm a z') @@ -124,9 +128,11 @@ export function ContractInfoDialog(props: { contract: Contract; bets: Bet[] }) { - {contract.mechanism === 'cpmm-1' && !contract.resolution && ( - - )} + {contract.mechanism === 'cpmm-1' && + !contract.resolution && + ENV_CONFIG.whitelistCreators?.includes(user?.username ?? '') && ( + + )}