-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0eaa0d5
commit efea825
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
/dist | ||
/coverage | ||
*.md |
11 changes: 6 additions & 5 deletions
11
packages/invoice-template/src/PolishInvoiceTemplate/polishInvoice.service.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import * as React from "react" | ||
import { PolishInvoiceTemplate } from "@leancodepl/invoice-template"; | ||
import * as React from "react"; | ||
import { PdfRenderer } from "@leancodepl/pdf-renderer"; | ||
import { Injectable } from "@nestjs/common"; | ||
import { PolishInvoiceTemplateProps } from "."; | ||
import { PolishInvoiceTemplate, PolishInvoiceTemplateProps } from "."; | ||
import { pdfRendererConfig } from "./fontsConfig"; | ||
|
||
@Injectable() | ||
export class PolishInvoiceService { | ||
constructor(private readonly pdfRenderer: PdfRenderer) {} | ||
|
||
renderInvoice(props: PolishInvoiceTemplateProps) { | ||
return this.pdfRenderer.generatePdf({ element: <PolishInvoiceTemplate {...props} />, fonts: pdfRendererConfig }); | ||
return this.pdfRenderer.generatePdf({ | ||
element: <PolishInvoiceTemplate {...props} />, | ||
fonts: pdfRendererConfig, | ||
}); | ||
} | ||
} | ||
|