From a8de8368a26c0e3d0d146497e772f8e8f04195a6 Mon Sep 17 00:00:00 2001 From: Mythie Date: Sat, 22 Mar 2025 12:04:08 +1100 Subject: [PATCH] fix: hide powered by on certificate for platform documents --- .../_internal+/[__htmltopdf]+/certificate.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/remix/app/routes/_internal+/[__htmltopdf]+/certificate.tsx b/apps/remix/app/routes/_internal+/[__htmltopdf]+/certificate.tsx index 59dccf894..025efdada 100644 --- a/apps/remix/app/routes/_internal+/[__htmltopdf]+/certificate.tsx +++ b/apps/remix/app/routes/_internal+/[__htmltopdf]+/certificate.tsx @@ -6,6 +6,7 @@ import { redirect } from 'react-router'; import { match } from 'ts-pattern'; import { UAParser } from 'ua-parser-js'; +import { isDocumentPlatform } from '@documenso/ee/server-only/util/is-document-platform'; import { APP_I18N_OPTIONS, ZSupportedLanguageCodeSchema } from '@documenso/lib/constants/i18n'; import { RECIPIENT_ROLES_DESCRIPTION, @@ -59,6 +60,8 @@ export async function loader({ request }: Route.LoaderArgs) { throw redirect('/'); } + const isPlatformDocument = await isDocumentPlatform(document); + const documentLanguage = ZSupportedLanguageCodeSchema.parse(document.documentMeta?.language); const auditLogs = await getDocumentCertificateAuditLogs({ @@ -70,6 +73,7 @@ export async function loader({ request }: Route.LoaderArgs) { return { document, documentLanguage, + isPlatformDocument, auditLogs, messages, }; @@ -85,7 +89,7 @@ export async function loader({ request }: Route.LoaderArgs) { * Update: Maybe tags work now after RR7 migration. */ export default function SigningCertificate({ loaderData }: Route.ComponentProps) { - const { document, documentLanguage, auditLogs, messages } = loaderData; + const { document, documentLanguage, isPlatformDocument, auditLogs, messages } = loaderData; const { i18n, _ } = useLingui(); @@ -337,15 +341,17 @@ export default function SigningCertificate({ loaderData }: Route.ComponentProps) -
-
-

- {_(msg`Signing certificate provided by`)}: -

+ {isPlatformDocument && ( +
+
+

+ {_(msg`Signing certificate provided by`)}: +

- + +
-
+ )}
); }