From 252dd0008cfaffb21fb179f252793b1c171e299a Mon Sep 17 00:00:00 2001 From: Bilal Ahmad Bhat Date: Thu, 30 Nov 2023 13:12:15 +0530 Subject: [PATCH] feat: add link to homepage on the complete sign page for logged in users (#691) * feat: add link to homepage on the complete sign page for logged in users * feat: added ChevronLeft icon to the link * feat: remove icon from the link --- .../(signing)/sign/[token]/complete/page.tsx | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx index 67af3c7fa..b9a8ba6d7 100644 --- a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx @@ -2,6 +2,7 @@ import Link from 'next/link'; import { notFound } from 'next/navigation'; import { CheckCircle2, Clock8 } from 'lucide-react'; +import { getServerSession } from 'next-auth'; import { match } from 'ts-pattern'; import signingCelebration from '@documenso/assets/images/signing-celebration.png'; @@ -53,6 +54,9 @@ export default async function CompletedSigningPage({ fields.find((field) => field.type === FieldType.NAME)?.customText || recipient.email; + const sessionData = await getServerSession(); + const isLoggedIn = !!sessionData?.user; + return (
{/* Card with recipient */} @@ -105,15 +109,21 @@ export default async function CompletedSigningPage({ />
-

- Want to send slick signing links like this one?{' '} - - Check out Documenso. + {isLoggedIn ? ( + + Go Back Home -

+ ) : ( +

+ Want to send slick signing links like this one?{' '} + + Check out Documenso. + +

+ )} );