diff --git a/web/components/contract-card.tsx b/web/components/contract-card.tsx
index f1a1c3b2..80e70c41 100644
--- a/web/components/contract-card.tsx
+++ b/web/components/contract-card.tsx
@@ -19,9 +19,8 @@ import { fromNow } from '../lib/util/time'
import { Avatar } from './avatar'
import { Spacer } from './layout/spacer'
import { useState } from 'react'
-import { TweetButton } from './tweet-button'
import { getProbability } from '../../common/calculate'
-import { ShareEmbedButton } from './share-embed-button'
+import { ContractInfoDialog } from './contract-info-dialog'
export function ContractCard(props: {
contract: Contract
@@ -179,11 +178,9 @@ export function ContractDetails(props: {
const { closeTime, creatorName, creatorUsername } = contract
const { volumeLabel, createdDate, resolvedDate } = contractMetrics(contract)
- const tweetText = getTweetText(contract, !!isCreator)
-
return (
-
+
-
-
+
+
>
)}
@@ -331,24 +328,3 @@ function EditableCloseDate(props: {
>
)
}
-
-const getTweetText = (contract: Contract, isCreator: boolean) => {
- const { question, creatorName, resolution, outcomeType } = contract
- const isBinary = outcomeType === 'BINARY'
-
- const tweetQuestion = isCreator
- ? question
- : `${question} Asked by ${creatorName}.`
- const tweetDescription = resolution
- ? `Resolved ${resolution}!`
- : isBinary
- ? `Currently ${getBinaryProbPercent(
- contract
- )} chance, place your bets here:`
- : `Submit your own answer:`
-
- const timeParam = `${Date.now()}`.substring(7)
- const url = `https://manifold.markets${contractPath(contract)}?t=${timeParam}`
-
- return `${tweetQuestion}\n\n${tweetDescription}\n\n${url}`
-}
diff --git a/web/components/contract-info-dialog.tsx b/web/components/contract-info-dialog.tsx
new file mode 100644
index 00000000..e000bf71
--- /dev/null
+++ b/web/components/contract-info-dialog.tsx
@@ -0,0 +1,88 @@
+import { DotsHorizontalIcon } from '@heroicons/react/outline'
+import clsx from 'clsx'
+import { useState } from 'react'
+import { Contract } from '../../common/contract'
+import { useFoldsWithTags } from '../hooks/use-fold'
+import { useUser } from '../hooks/use-user'
+import { contractPath, getBinaryProbPercent } from '../lib/firebase/contracts'
+import { Col } from './layout/col'
+import { Modal } from './layout/modal'
+import { Row } from './layout/row'
+import { ShareEmbedButton } from './share-embed-button'
+import { TagsInput } from './tags-input'
+import { FoldTagList } from './tags-list'
+import { Title } from './title'
+import { TweetButton } from './tweet-button'
+
+export function ContractInfoDialog(props: { contract: Contract }) {
+ const { contract } = props
+
+ const [open, setOpen] = useState(false)
+
+ const user = useUser()
+
+ const folds = (useFoldsWithTags(contract.tags) ?? []).filter(
+ (fold) => fold.followCount > 1 || user?.id === fold.curatorId
+ )
+
+ return (
+ <>
+
+
+
+
+
+
+ Share
+
+
+
+
+
+ Communities
+
+
+
+ Tags
+
+
+
+
+
+ >
+ )
+}
+
+const getTweetText = (contract: Contract, isCreator: boolean) => {
+ const { question, creatorName, resolution, outcomeType } = contract
+ const isBinary = outcomeType === 'BINARY'
+
+ const tweetQuestion = isCreator
+ ? question
+ : `${question}\nAsked by ${creatorName}.`
+ const tweetDescription = resolution
+ ? `Resolved ${resolution}!`
+ : isBinary
+ ? `Currently ${getBinaryProbPercent(
+ contract
+ )} chance, place your bets here:`
+ : `Submit your own answer:`
+
+ const timeParam = `${Date.now()}`.substring(7)
+ const url = `https://manifold.markets${contractPath(contract)}?t=${timeParam}`
+
+ return `${tweetQuestion}\n\n${tweetDescription}\n\n${url}`
+}
diff --git a/web/components/contract-overview.tsx b/web/components/contract-overview.tsx
index c94dbaf5..328bfc69 100644
--- a/web/components/contract-overview.tsx
+++ b/web/components/contract-overview.tsx
@@ -9,10 +9,7 @@ import clsx from 'clsx'
import { ContractDetails, ResolutionOrChance } from './contract-card'
import { Bet } from '../../common/bet'
import { Comment } from '../../common/comment'
-import { RevealableTagsInput, TagsInput } from './tags-input'
import BetRow from './bet-row'
-import { Fold } from '../../common/fold'
-import { FoldTagList } from './tags-list'
import { ContractActivity } from './feed/contract-activity'
import { AnswersGraph } from './answers/answers-graph'
import { DPM, FreeResponse, FullContract } from '../../common/contract'
@@ -21,11 +18,10 @@ export const ContractOverview = (props: {
contract: Contract
bets: Bet[]
comments: Comment[]
- folds: Fold[]
children?: any
className?: string
}) => {
- const { contract, bets, comments, folds, children, className } = props
+ const { contract, bets, comments, children, className } = props
const { question, resolution, creatorId, outcomeType } = contract
const user = useUser()
@@ -75,26 +71,6 @@ export const ContractOverview = (props: {
{children}
-
- {folds.length === 0 ? (
-
- ) : (
-
- )}
-
-
-
- {folds.length === 0 ? (
-
- ) : (
-
- )}
-
-
- {folds.length > 0 && (
-
- )}
-
`
+
+ copyToClipboard(embedCode)
+}
+
export function ShareEmbedButton(props: { contract: Contract }) {
const { contract } = props
- const copyEmbed = () => {
- const title = contract.question
- const src = `https://${DOMAIN}/embed${contractPath(contract)}`
-
- const embedCode = ``
-
- copyToClipboard(embedCode)
- }
-
return (