diff --git a/common/envs/constants.ts b/common/envs/constants.ts index 48f9bf63..89d040e8 100644 --- a/common/envs/constants.ts +++ b/common/envs/constants.ts @@ -44,3 +44,7 @@ export const CORS_ORIGIN_VERCEL = new RegExp( ) // Any localhost server on any port export const CORS_ORIGIN_LOCALHOST = /^http:\/\/localhost:\d+$/ + +export function firestoreConsolePath(contractId: string) { + return `https://console.firebase.google.com/project/${PROJECT_ID}/firestore/data/~2Fcontracts~2F${contractId}` +} diff --git a/web/components/contract/contract-info-dialog.tsx b/web/components/contract/contract-info-dialog.tsx index be24d0b5..63c9ac72 100644 --- a/web/components/contract/contract-info-dialog.tsx +++ b/web/components/contract/contract-info-dialog.tsx @@ -13,6 +13,9 @@ import { Col } from '../layout/col' import { Modal } from '../layout/modal' import { Title } from '../title' import { InfoTooltip } from '../info-tooltip' +import { useAdmin, useDev } from 'web/hooks/use-admin' +import { SiteLink } from '../site-link' +import { firestoreConsolePath } 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' @@ -21,10 +24,12 @@ export function ContractInfoDialog(props: { contract: Contract; bets: Bet[] }) { const { contract, bets } = props const [open, setOpen] = useState(false) + const isDev = useDev() + const isAdmin = useAdmin() const formatTime = (dt: number) => dayjs(dt).format('MMM DD, YYYY hh:mm a z') - const { createdTime, closeTime, resolutionTime, mechanism, outcomeType } = + const { createdTime, closeTime, resolutionTime, mechanism, outcomeType, id } = contract const tradersCount = uniqBy( @@ -121,6 +126,18 @@ export function ContractInfoDialog(props: { contract: Contract; bets: Bet[] }) {