Copy contract url doesn't use current url
This commit is contained in:
parent
e53cde5b34
commit
ff1cb68077
|
@ -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 }) {
|
|||
<Menu
|
||||
as="div"
|
||||
className="relative z-10 flex-shrink-0"
|
||||
onMouseUp={() => copyCurrentUrl(contract)}
|
||||
onMouseUp={() => copyContractUrl(contract)}
|
||||
>
|
||||
<Menu.Button
|
||||
className="btn btn-xs normal-case"
|
||||
|
|
Loading…
Reference in New Issue
Block a user