mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
Truncate prop added
This commit is contained in:
@ -19,6 +19,7 @@ type DialogProps = {
|
||||
formValues: FormValue[];
|
||||
setLoading: (loading: boolean) => void;
|
||||
icon: React.ReactNode;
|
||||
trunate: boolean;
|
||||
};
|
||||
|
||||
export function Dialog({
|
||||
@ -29,11 +30,17 @@ export function Dialog({
|
||||
formValues,
|
||||
setLoading,
|
||||
icon,
|
||||
trunate = true,
|
||||
}: DialogProps) {
|
||||
const unsentEmailsLength = formValues.filter(
|
||||
(s: any) => s.email && s.sendStatus != "SENT"
|
||||
).length;
|
||||
|
||||
if (trunate && document.title.length > 20) {
|
||||
document.title = document.title.substring(0, 7) + "..." +
|
||||
document.title.substring(document.title.length - 7);
|
||||
}
|
||||
|
||||
return (
|
||||
<Transition.Root show={open} as={Fragment}>
|
||||
<DialogComponent as="div" className="relative z-10" onClose={setOpen}>
|
||||
@ -71,9 +78,7 @@ export function Dialog({
|
||||
</DialogComponent.Title>
|
||||
<div className="mt-2">
|
||||
<p className="text-sm text-gray-500">
|
||||
{`"${document.title.length > 20 ? document.title.substring(0, 7) + "..." +
|
||||
document.title.substring(document.title.length - 7) : document.title}"
|
||||
will be sent to ${unsentEmailsLength} recipients.`}
|
||||
{`"${document.title}" will be sent to ${unsentEmailsLength} recipients.`}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user