Created
June 5, 2020 11:36
-
-
Save kagundajm/96b41efd4f4ecf55d5da93b15395713d to your computer and use it in GitHub Desktop.
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
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