Fix comment links from /activity & add to emails (#320)

This commit is contained in:
Ian Philips 2022-05-25 16:47:08 -06:00 committed by GitHub
parent f0d44be2f4
commit 1334840ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -262,7 +262,7 @@ export const sendNewCommentEmail = async (
return return
const { question, creatorUsername, slug } = contract const { question, creatorUsername, slug } = contract
const marketUrl = `https://${DOMAIN}/${creatorUsername}/${slug}` const marketUrl = `https://${DOMAIN}/${creatorUsername}/${slug}#${comment.id}`
const unsubscribeUrl = `https://us-central1-${PROJECT_ID}.cloudfunctions.net/unsubscribe?id=${userId}&type=market-comment` const unsubscribeUrl = `https://us-central1-${PROJECT_ID}.cloudfunctions.net/unsubscribe?id=${userId}&type=market-comment`

View File

@ -21,14 +21,11 @@ export function CopyLinkDateTimeComponent(props: {
event: React.MouseEvent<HTMLAnchorElement, MouseEvent> event: React.MouseEvent<HTMLAnchorElement, MouseEvent>
) { ) {
event.preventDefault() event.preventDefault()
let elementLocation = `https://${ENV_CONFIG.domain}${contractPath(
contract
)}#${elementId}`
let currentLocation = window.location.href.includes('/home') copyToClipboard(elementLocation)
? `https://${ENV_CONFIG.domain}${contractPath(contract)}#${elementId}`
: window.location.href
if (currentLocation.includes('#')) {
currentLocation = currentLocation.split('#')[0]
}
copyToClipboard(`${currentLocation}#${elementId}`)
setShowToast(true) setShowToast(true)
setTimeout(() => setShowToast(false), 2000) setTimeout(() => setShowToast(false), 2000)
} }

View File

@ -156,7 +156,7 @@ export function FeedComment(props: {
<Row <Row
className={clsx( className={clsx(
'flex space-x-1.5 transition-all duration-1000 sm:space-x-3', 'flex space-x-1.5 transition-all duration-1000 sm:space-x-3',
highlighted ? `-m-2 rounded bg-indigo-500/[0.2] p-2` : '' highlighted ? `-m-1 rounded bg-indigo-500/[0.2] p-2` : ''
)} )}
> >
<Avatar <Avatar