When duplicating, add the original link in description
This commit is contained in:
parent
434b8b9dbe
commit
2d1e76eae8
|
@ -1,7 +1,9 @@
|
||||||
import { DuplicateIcon } from '@heroicons/react/outline'
|
import { DuplicateIcon } from '@heroicons/react/outline'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { Contract } from 'common/contract'
|
import { Contract } from 'common/contract'
|
||||||
|
import { ENV_CONFIG } from 'common/envs/constants'
|
||||||
import { getMappedValue } from 'common/pseudo-numeric'
|
import { getMappedValue } from 'common/pseudo-numeric'
|
||||||
|
import { contractPath } from 'web/lib/firebase/contracts'
|
||||||
import { trackCallback } from 'web/lib/service/analytics'
|
import { trackCallback } from 'web/lib/service/analytics'
|
||||||
|
|
||||||
export function DuplicateContractButton(props: {
|
export function DuplicateContractButton(props: {
|
||||||
|
@ -34,7 +36,9 @@ function duplicateContractHref(contract: Contract) {
|
||||||
const params = {
|
const params = {
|
||||||
q: contract.question,
|
q: contract.question,
|
||||||
closeTime: contract.closeTime || 0,
|
closeTime: contract.closeTime || 0,
|
||||||
description: contract.description,
|
description:
|
||||||
|
(contract.description ? `${contract.description}\n\n` : '') +
|
||||||
|
`(Copied from https://${ENV_CONFIG.domain}${contractPath(contract)})`,
|
||||||
outcomeType: contract.outcomeType,
|
outcomeType: contract.outcomeType,
|
||||||
} as Record<string, any>
|
} as Record<string, any>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user