mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 09:25:08 +10:00
c2744cbe07
Audited every className token in the repo by compiling them against the shared tailwind config and diffing generated selectors. The following dead tokens were replaced with the intended, existing ones: - text-sbase -> text-base (document invite email button, botched sm->base edit) - text-primary-forground -> text-foreground (admin license card; the literal spelling fix would render 10% lightness text on the dark card, the inherited foreground colour is the intended look) - tracking-tigh -> tracking-tight (signing waiting page heading) - font-sm -> text-sm (4 delete-confirmation dialogs) - dark:text-muted-background -> dark:text-muted (field drag ghost in 4 flows; restores the dark mode readability fix intended by #1242) - placeholder:text-foreground-muted -> placeholder:text-muted-foreground (command palette input) - text-medium -> font-medium (org create dialog free plan, matches paid plans) - text-md -> text-base (envelope drop zone hint) - justify-left -> justify-start (member invite remove button, no visual change) - removed stray "gradie" fragment and text-dark (no dark colour exists) No visual change except where the dead class silently disabled intended styling (email button size, drag ghost dark mode text, dialog confirm text size).
108 lines
3.8 KiB
TypeScript
108 lines
3.8 KiB
TypeScript
import { RECIPIENT_ROLES_DESCRIPTION } from '@documenso/lib/constants/recipient-roles';
|
|
import { useLingui } from '@lingui/react';
|
|
import { Trans } from '@lingui/react/macro';
|
|
import { OrganisationType, RecipientRole } from '@prisma/client';
|
|
import { match, P } from 'ts-pattern';
|
|
|
|
import { Button, Section, Text } from '../components';
|
|
import { TemplateDocumentImage } from './template-document-image';
|
|
|
|
export interface TemplateDocumentInviteProps {
|
|
inviterName: string;
|
|
inviterEmail: string;
|
|
documentName: string;
|
|
signDocumentLink: string;
|
|
assetBaseUrl: string;
|
|
role: RecipientRole;
|
|
selfSigner: boolean;
|
|
teamName?: string;
|
|
includeSenderDetails?: boolean;
|
|
organisationType?: OrganisationType;
|
|
}
|
|
|
|
export const TemplateDocumentInvite = ({
|
|
inviterName,
|
|
documentName,
|
|
signDocumentLink,
|
|
assetBaseUrl,
|
|
role,
|
|
selfSigner,
|
|
teamName,
|
|
includeSenderDetails,
|
|
organisationType,
|
|
}: TemplateDocumentInviteProps) => {
|
|
const { _ } = useLingui();
|
|
|
|
const { actionVerb } = RECIPIENT_ROLES_DESCRIPTION[role];
|
|
|
|
return (
|
|
<>
|
|
<TemplateDocumentImage className="mt-6" assetBaseUrl={assetBaseUrl} />
|
|
|
|
<Section>
|
|
<Text className="mx-auto mb-0 max-w-[80%] text-center font-semibold text-foreground text-lg">
|
|
{match({ selfSigner, organisationType, includeSenderDetails, teamName })
|
|
.with({ selfSigner: true }, () => (
|
|
<Trans>
|
|
Please {_(actionVerb).toLowerCase()} your document
|
|
<br />"{documentName}"
|
|
</Trans>
|
|
))
|
|
.with(
|
|
{
|
|
organisationType: OrganisationType.ORGANISATION,
|
|
includeSenderDetails: true,
|
|
teamName: P.string,
|
|
},
|
|
() => (
|
|
<Trans>
|
|
{inviterName} on behalf of "{teamName}" has invited you to {_(actionVerb).toLowerCase()}
|
|
<br />"{documentName}"
|
|
</Trans>
|
|
),
|
|
)
|
|
.with({ organisationType: OrganisationType.ORGANISATION, teamName: P.string }, () => (
|
|
<Trans>
|
|
{teamName} has invited you to {_(actionVerb).toLowerCase()}
|
|
<br />"{documentName}"
|
|
</Trans>
|
|
))
|
|
.otherwise(() => (
|
|
<Trans>
|
|
{inviterName} has invited you to {_(actionVerb).toLowerCase()}
|
|
<br />"{documentName}"
|
|
</Trans>
|
|
))}
|
|
</Text>
|
|
|
|
<Text className="my-1 text-center text-base text-muted-foreground">
|
|
{match(role)
|
|
.with(RecipientRole.SIGNER, () => <Trans>Continue by signing the document.</Trans>)
|
|
.with(RecipientRole.VIEWER, () => <Trans>Continue by viewing the document.</Trans>)
|
|
.with(RecipientRole.APPROVER, () => <Trans>Continue by approving the document.</Trans>)
|
|
.with(RecipientRole.CC, () => '')
|
|
.with(RecipientRole.ASSISTANT, () => <Trans>Continue by assisting with the document.</Trans>)
|
|
.exhaustive()}
|
|
</Text>
|
|
|
|
<Section className="mt-8 mb-6 text-center">
|
|
<Button
|
|
className="inline-flex items-center justify-center rounded-lg bg-primary px-6 py-3 text-center font-medium text-base text-primary-foreground no-underline"
|
|
href={signDocumentLink}
|
|
>
|
|
{match(role)
|
|
.with(RecipientRole.SIGNER, () => <Trans>View Document to sign</Trans>)
|
|
.with(RecipientRole.VIEWER, () => <Trans>View Document</Trans>)
|
|
.with(RecipientRole.APPROVER, () => <Trans>View Document to approve</Trans>)
|
|
.with(RecipientRole.CC, () => '')
|
|
.with(RecipientRole.ASSISTANT, () => <Trans>View Document to assist</Trans>)
|
|
.exhaustive()}
|
|
</Button>
|
|
</Section>
|
|
</Section>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TemplateDocumentInvite;
|