+
@@ -90,7 +88,10 @@ export const EnvelopeSignerHeader = () => {
const MobileDropdownMenu = () => {
const { envelope, recipient } = useRequiredEnvelopeSigningContext();
- const { allowDocumentRejection } = useEmbedSigningContext() || {};
+ const embedSigningContext = useEmbedSigningContext();
+
+ const isEmbedSigning = embedSigningContext !== null;
+ const { allowDocumentRejection } = embedSigningContext || {};
return (
@@ -130,6 +131,8 @@ const MobileDropdownMenu = () => {
}
/>
)}
+
+ {!isEmbedSigning && }
);
diff --git a/apps/remix/app/components/general/public-legal-links.tsx b/apps/remix/app/components/general/public-legal-links.tsx
index d21c81949..1bdc0e96c 100644
--- a/apps/remix/app/components/general/public-legal-links.tsx
+++ b/apps/remix/app/components/general/public-legal-links.tsx
@@ -4,7 +4,9 @@ import {
NEXT_PUBLIC_TERMS_OF_SERVICE_URL,
} from '@documenso/lib/constants/app';
import { cn } from '@documenso/ui/lib/utils';
-import { Trans } from '@lingui/react/macro';
+import { DropdownMenuItem, DropdownMenuSeparator } from '@documenso/ui/primitives/dropdown-menu';
+import { msg } from '@lingui/core/macro';
+import { useLingui } from '@lingui/react';
import { Link } from 'react-router';
export type PublicLegalLinksProps = {
@@ -12,49 +14,70 @@ export type PublicLegalLinksProps = {
};
export const PublicLegalLinks = ({ className }: PublicLegalLinksProps) => {
- const termsUrl = NEXT_PUBLIC_TERMS_OF_SERVICE_URL();
- const privacyUrl = NEXT_PUBLIC_PRIVACY_POLICY_URL();
- const imprintUrl = NEXT_PUBLIC_IMPRINT_URL();
+ const { _ } = useLingui();
+
+ const links = getPublicLegalLinks();
+
+ if (links.length === 0) {
+ return null;
+ }
return (
- {termsUrl && (
+ {links.map((link) => (
- Terms of Service
+ {_(link.label)}
- )}
-
- {privacyUrl && (
-
- Privacy Policy
-
- )}
-
- {imprintUrl && (
-
- Imprint
-
- )}
+ ))}
);
};
+
+export const PublicLegalLinksDropdownMenuItems = () => {
+ const { _ } = useLingui();
+
+ const links = getPublicLegalLinks();
+
+ if (links.length === 0) {
+ return null;
+ }
+
+ return (
+ <>
+
+
+ {links.map((link) => (
+
+
+ {_(link.label)}
+
+
+ ))}
+ >
+ );
+};
+
+const getPublicLegalLinks = () => {
+ const termsUrl = NEXT_PUBLIC_TERMS_OF_SERVICE_URL();
+ const privacyUrl = NEXT_PUBLIC_PRIVACY_POLICY_URL();
+ const imprintUrl = NEXT_PUBLIC_IMPRINT_URL();
+
+ const links = [
+ termsUrl ? { label: msg`Terms of Service`, href: termsUrl } : null,
+ privacyUrl ? { label: msg`Privacy Policy`, href: privacyUrl } : null,
+ imprintUrl ? { label: msg`Imprint`, href: imprintUrl } : null,
+ ];
+
+ return links.filter((link) => link !== null);
+};
diff --git a/apps/remix/app/routes/_recipient+/_layout.tsx b/apps/remix/app/routes/_recipient+/_layout.tsx
index b074e4462..fde4a7998 100644
--- a/apps/remix/app/routes/_recipient+/_layout.tsx
+++ b/apps/remix/app/routes/_recipient+/_layout.tsx
@@ -10,8 +10,6 @@ import { useEffect } from 'react';
import { isRouteErrorResponse, Link, Outlet } from 'react-router';
import { Header as AuthenticatedHeader } from '~/components/general/app-header';
import { GenericErrorLayout } from '~/components/general/generic-error-layout';
-import { PublicLegalLinks } from '~/components/general/public-legal-links';
-
import type { Route } from './+types/_layout';
export function meta() {
@@ -37,24 +35,16 @@ export default function RecipientLayout({ matches }: Route.ComponentProps) {
);
return (
-
-
- {!hideHeader && sessionData?.user &&
}
+
+ {!hideHeader && sessionData?.user &&
}
-
-
-
-
-
- {!hideHeader && (
-
- )}
+
+
+
);
}