Closed rodrigopavezi closed 3 weeks ago
The changes involve modifications to the package.json
file, where three dependencies were removed: @requestnetwork/shared
, file-saver
, and react-pdf-html
. Additionally, the useExportPDF
hook in src/app/request/[id]/page.tsx
was updated from a named to a default import. In src/lib/hooks/use-export-pdf.tsx
, the useExportPDF
function was enhanced to utilize the html2pdf
library for PDF generation, introducing a new helper function for calculating item totals and improving the overall structure of the PDF export process.
File | Change Summary |
---|---|
package.json |
Removed dependencies: @requestnetwork/shared , file-saver , react-pdf-html . |
src/app/request/[id]/page.tsx |
Changed import of useExportPDF from named to default import. |
src/lib/hooks/use-export-pdf.tsx |
Updated useExportPDF to default export; added calculateItemTotal function; integrated html2pdf for PDF generation; added global declaration for html2pdf . |
sequenceDiagram
participant User
participant RequestPage
participant useExportPDF
participant html2pdf
User->>RequestPage: Request PDF export
RequestPage->>useExportPDF: Call exportPDF()
useExportPDF->>html2pdf: Ensure html2pdf is loaded
useExportPDF->>useExportPDF: Calculate item totals
useExportPDF->>html2pdf: Generate PDF from HTML content
html2pdf-->>useExportPDF: PDF generated
useExportPDF-->>RequestPage: Return generated PDF
RequestPage-->>User: Provide PDF download
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Invoice format fixed
Fixes https://github.com/RequestNetwork/request-scan/issues/25
Changes:
Class extends value undefined is not a constructor or null
issueSummary by CodeRabbit
New Features
html2pdf
library, allowing for more customization and improved user experience.Bug Fixes
Chores