11import {
22 Document ,
3- Image ,
43 Page ,
54 Text ,
65 View ,
@@ -58,10 +57,7 @@ const styles = StyleSheet.create({
5857 fontSize : 9 ,
5958 color : TEXT_MUTED ,
6059 } ,
61- headerLogo : {
62- height : 28 ,
63- objectFit : 'contain' as const ,
64- } ,
60+
6561 title : {
6662 fontSize : 20 ,
6763 fontFamily : 'Helvetica-Bold' ,
@@ -408,21 +404,13 @@ function PackageDetails({ variables }: PackageDetailsProps) {
408404interface ContractDocumentProps {
409405 template : ContractTemplate
410406 variables : Record < string , string >
411- logoDataUrl ?: string
412- }
413-
414- function svgToDataUrl ( svg : string ) : string {
415- const base64 = Buffer . from ( svg , 'utf-8' ) . toString ( 'base64' )
416- return `data:image/svg+xml;base64,${ base64 } `
417407}
418408
419409function PageHeader ( {
420410 headerText,
421- logoDataUrl,
422411 variables,
423412} : {
424413 headerText ?: string
425- logoDataUrl ?: string
426414 variables : Record < string , string >
427415} ) {
428416 const text = headerText
@@ -434,17 +422,12 @@ function PageHeader({
434422 < View style = { styles . accentBar } fixed />
435423 < View style = { styles . headerArea } >
436424 < Text style = { styles . headerText } > { text || '' } </ Text >
437- { logoDataUrl && < Image style = { styles . headerLogo } src = { logoDataUrl } /> }
438425 </ View >
439426 </ >
440427 )
441428}
442429
443- function ContractDocument ( {
444- template,
445- variables,
446- logoDataUrl,
447- } : ContractDocumentProps ) {
430+ function ContractDocument ( { template, variables } : ContractDocumentProps ) {
448431 const title = processTemplateVariables ( template . title , variables )
449432
450433 return (
@@ -454,11 +437,7 @@ function ContractDocument({
454437 >
455438 { /* Page 1: Partner Agreement */ }
456439 < Page size = "A4" style = { styles . page } >
457- < PageHeader
458- headerText = { template . headerText }
459- logoDataUrl = { logoDataUrl }
460- variables = { variables }
461- />
440+ < PageHeader headerText = { template . headerText } variables = { variables } />
462441
463442 < Text style = { styles . title } > { title } </ Text >
464443 < View style = { styles . titleDivider } />
@@ -518,11 +497,7 @@ function ContractDocument({
518497 { /* Appendix 1: General Terms & Conditions */ }
519498 { template . terms && template . terms . length > 0 && (
520499 < Page size = "A4" style = { styles . page } >
521- < PageHeader
522- headerText = { template . headerText }
523- logoDataUrl = { logoDataUrl }
524- variables = { variables }
525- />
500+ < PageHeader headerText = { template . headerText } variables = { variables } />
526501
527502 < Text style = { styles . appendixTitle } >
528503 Appendix 1: General Terms & Conditions
@@ -551,16 +526,7 @@ export async function generateContractPdf(
551526 ...context ,
552527 language : template . language ,
553528 } )
554- const logoDataUrl = context . conference . logoBright
555- ? svgToDataUrl ( context . conference . logoBright )
556- : undefined
557- const doc = (
558- < ContractDocument
559- template = { template }
560- variables = { variables }
561- logoDataUrl = { logoDataUrl }
562- />
563- )
529+ const doc = < ContractDocument template = { template } variables = { variables } />
564530 const buffer = await renderToBuffer ( doc )
565531 return Buffer . from ( buffer )
566532}
0 commit comments