Skip to content

Instantly share code, notes, and snippets.

@kagundajm
Created June 5, 2020 11:36
Show Gist options
  • Save kagundajm/96b41efd4f4ecf55d5da93b15395713d to your computer and use it in GitHub Desktop.
Save kagundajm/96b41efd4f4ecf55d5da93b15395713d to your computer and use it in GitHub Desktop.
import React from 'react';
import { Page, Document, Image, StyleSheet } from '@react-pdf/renderer';
import InvoiceTitle from './InvoiceTitle'
import BillTo from './BillTo'
import InvoiceNo from './InvoiceNo'
import InvoiceItemsTable from './InvoiceItemsTable'
import InvoiceThankYouMsg from './InvoiceThankYouMsg'
import logo from '../../../src/logo.png'
const styles = StyleSheet.create({
page: {
fontFamily: 'Helvetica',
fontSize: 11,
paddingTop: 30,
paddingLeft:60,
paddingRight:60,
lineHeight: 1.5,
flexDirection: 'column',
},
logo: {
width: 74,
height: 66,
marginLeft: 'auto',
marginRight: 'auto'
}
});
const Invoice = ({invoice}) => (
<Document>
<Page size="A4" style={styles.page}>
<Image style={styles.logo} src={logo} />
<InvoiceTitle title='Invoice'/>
<InvoiceNo invoice={invoice}/>
<BillTo invoice={invoice}/>
<InvoiceItemsTable invoice={invoice} />
<InvoiceThankYouMsg />
</Page>
</Document>
);
export default Invoice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment