diff --git a/firestore.rules b/firestore.rules
index 385e2f44..8c419b01 100644
--- a/firestore.rules
+++ b/firestore.rules
@@ -25,7 +25,7 @@ service cloud.firestore {
match /contracts/{contractId} {
allow read;
allow update: if request.resource.data.diff(resource.data).affectedKeys()
- .hasOnly(['description', 'tags', 'lowercaseTags']);
+ .hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags']);
allow update: if isAdmin();
allow delete: if resource.data.creatorId == request.auth.uid;
}
diff --git a/web/components/contract-card.tsx b/web/components/contract-card.tsx
index 501987c8..7491efbe 100644
--- a/web/components/contract-card.tsx
+++ b/web/components/contract-card.tsx
@@ -1,5 +1,7 @@
import clsx from 'clsx'
import Link from 'next/link'
+import { ClockIcon, DatabaseIcon, PencilIcon } from '@heroicons/react/outline'
+import { TrendingUpIcon } from '@heroicons/react/solid'
import { Row } from '../components/layout/row'
import { formatMoney } from '../../common/util/format'
import { UserLink } from './user-page'
@@ -8,15 +10,15 @@ import {
contractMetrics,
contractPath,
getBinaryProbPercent,
+ updateContract,
} from '../lib/firebase/contracts'
import { Col } from './layout/col'
import dayjs from 'dayjs'
-import { TrendingUpIcon } from '@heroicons/react/solid'
import { DateTimeTooltip } from './datetime-tooltip'
-import { ClockIcon, DatabaseIcon } from '@heroicons/react/outline'
import { fromNow } from '../lib/util/time'
import { Avatar } from './avatar'
import { Spacer } from './layout/spacer'
+import { useState } from 'react'
export function ContractCard(props: {
contract: Contract
@@ -160,8 +162,11 @@ function AbbrContractDetails(props: {
)
}
-export function ContractDetails(props: { contract: Contract }) {
- const { contract } = props
+export function ContractDetails(props: {
+ contract: Contract
+ isCreator?: boolean
+}) {
+ const { contract, isCreator } = props
const { closeTime, creatorName, creatorUsername } = contract
const { truePool, createdDate, resolvedDate } = contractMetrics(contract)
@@ -202,15 +207,12 @@ export function ContractDetails(props: { contract: Contract }) {
{!resolvedDate && closeTime && (
<>
- {' - '}
-