Only show liquidity panel to Hanania

This commit is contained in:
James Grugett 2022-08-07 16:04:50 -07:00
parent c921590643
commit 367046a6e0

View File

@ -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[] }) {
</tbody>
</table>
{contract.mechanism === 'cpmm-1' && !contract.resolution && (
<LiquidityPanel contract={contract} />
)}
{contract.mechanism === 'cpmm-1' &&
!contract.resolution &&
ENV_CONFIG.whitelistCreators?.includes(user?.username ?? '') && (
<LiquidityPanel contract={contract} />
)}
</Col>
</Modal>
</>