diff --git a/web/components/copy-link-button.tsx b/web/components/copy-link-button.tsx index b9480971..1e944311 100644 --- a/web/components/copy-link-button.tsx +++ b/web/components/copy-link-button.tsx @@ -3,10 +3,11 @@ import { LinkIcon } from '@heroicons/react/outline' import { Menu, Transition } from '@headlessui/react' import { Contract } from '../../common/contract' import { copyToClipboard } from '../lib/util/copy' +import { contractPath } from '../lib/firebase/contracts' +import { ENV_CONFIG } from '../../common/envs/constants' -function copyCurrentUrl(contract: Contract) { - const url = window.location.href - copyToClipboard(url) +function copyContractUrl(contract: Contract) { + copyToClipboard(`https://${ENV_CONFIG.domain}${contractPath(contract)}`) } export function CopyLinkButton(props: { contract: Contract }) { @@ -16,7 +17,7 @@ export function CopyLinkButton(props: { contract: Contract }) {