Update .env.example with clearer instructions for PRINTER_APP_URL, remove pdf-lib dependency from package.json, and adjust translations for alignment and zoom features across multiple locales. Improve template layout consistency in various components.

This commit is contained in:
Amruth Pillai
2026-01-24 10:43:12 +01:00
parent 4e73a81d4b
commit c875cc858d
79 changed files with 1399 additions and 1142 deletions
@@ -36,9 +36,9 @@ export function BuilderDock() {
);
const publicUrl = useMemo(() => {
if (!session || !resume) return "";
if (!session?.user.username || !resume?.slug) return "";
return `${window.location.origin}/${session.user.username}/${resume.slug}`;
}, [session, resume]);
}, [session?.user.username, resume?.slug]);
const onCopyUrl = useCallback(async () => {
await copyToClipboard(publicUrl);
@@ -46,22 +46,27 @@ export function BuilderDock() {
}, [publicUrl, copyToClipboard]);
const onDownloadJSON = useCallback(async () => {
if (!resume) return;
const jsonString = JSON.stringify(resume, null, 2);
const blob = new Blob([jsonString], { type: "application/json" });
if (!resume?.data) return;
const filename = generateFilename(resume.data.basics.name, "json");
const jsonString = JSON.stringify(resume.data, null, 2);
const blob = new Blob([jsonString], { type: "application/json" });
downloadWithAnchor(blob, filename);
}, [resume]);
}, [resume?.data]);
const onDownloadPDF = useCallback(async () => {
if (!resume) return;
if (!resume?.id) return;
const filename = generateFilename(resume.data.basics.name, "pdf");
const { url } = await printResumeAsPDF({ id: resume.id });
downloadFromUrl(url, filename);
}, [resume, printResumeAsPDF]);
try {
const { url } = await printResumeAsPDF({ id: resume.id });
downloadFromUrl(url, filename);
} catch (error) {
toast.error(t`There was a problem while generating the PDF, please try again in some time.`);
console.error("[Error from printResumeAsPDF]:", error);
}
}, [resume?.id, resume?.data.basics.name, printResumeAsPDF]);
return (
<div className="fixed inset-x-0 bottom-4 flex items-center justify-center">
@@ -1,7 +1,9 @@
import { t } from "@lingui/core/macro";
import { Trans } from "@lingui/react/macro";
import { CircleNotchIcon, FileJsIcon, FilePdfIcon } from "@phosphor-icons/react";
import { useMutation } from "@tanstack/react-query";
import { useCallback } from "react";
import { toast } from "sonner";
import { useResumeStore } from "@/components/resume/store/resume";
import { Button } from "@/components/ui/button";
import { orpc } from "@/integrations/orpc/client";
@@ -17,7 +19,7 @@ export function ExportSectionBuilder() {
const onDownloadJSON = useCallback(() => {
const filename = generateFilename(resume.data.basics.name, "json");
const jsonString = JSON.stringify(resume, null, 2);
const jsonString = JSON.stringify(resume.data, null, 2);
const blob = new Blob([jsonString], { type: "application/json" });
downloadWithAnchor(blob, filename);
@@ -25,9 +27,14 @@ export function ExportSectionBuilder() {
const onDownloadPDF = useCallback(async () => {
const filename = generateFilename(resume.data.basics.name, "pdf");
const { url } = await printResumeAsPDF({ id: resume.id });
downloadFromUrl(url, filename);
try {
const { url } = await printResumeAsPDF({ id: resume.id });
downloadFromUrl(url, filename);
} catch (error) {
toast.error(t`There was a problem while generating the PDF, please try again in some time.`);
console.error("[Error from printResumeAsPDF]:", error);
}
}, [resume, printResumeAsPDF]);
return (