From 3ec4ec6b67c532285d2a440e273d63654d8a7d05 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 27 Sep 2022 17:48:41 -0400 Subject: [PATCH] Add share button --- web/pages/date-docs/[username].tsx | 59 +++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/web/pages/date-docs/[username].tsx b/web/pages/date-docs/[username].tsx index 1c9361ee..33d2504a 100644 --- a/web/pages/date-docs/[username].tsx +++ b/web/pages/date-docs/[username].tsx @@ -1,4 +1,5 @@ import { getDateDoc } from 'web/lib/firebase/posts' +import { LinkIcon } from '@heroicons/react/outline' import { Page } from 'web/components/page' import dayjs from 'dayjs' @@ -11,6 +12,12 @@ import { SiteLink } from 'web/components/site-link' import { User } from 'web/lib/firebase/users' import { DOMAIN } from 'common/envs/constants' import Custom404 from '../404' +import { ShareIcon } from '@heroicons/react/solid' +import clsx from 'clsx' +import { Button } from 'web/components/button' +import { track } from '@amplitude/analytics-browser' +import toast from 'react-hot-toast' +import { copyToClipboard } from 'web/lib/util/copy' export async function getStaticProps(props: { params: { username: string } }) { const { username } = props.params @@ -54,31 +61,57 @@ export function DateDocPost(props: { creator: User link?: boolean }) { - const { dateDoc, creator } = props + const { dateDoc, creator, link } = props const { content, birthday, photoUrl, contractSlug } = dateDoc const { name, username } = creator const age = dayjs().diff(birthday, 'year') + const shareUrl = `https://${DOMAIN}/date-docs/${username}` const marketUrl = `https://${DOMAIN}/${username}/${contractSlug}` return ( - - - - {name} - - + + +
{name}, {age}
+ + + +
+ {name}