Closed wright1 closed 4 years ago
I will add the locations this evening please don't merge until the locations are added.
I've added locations to the pdf, please review.
@wright1 I added markers for location, and also removed Roboto font.
Errors in the font import seems to be a known issue, and I noticed this was causing the previously mentioned error, as well as preventing the 2nd pdf from downloading.
I have commented out all references to the font, and the import, until we find a fix. Will try out stuff in this thread:
https://github.com/diegomura/react-pdf/issues/310
...Tried out stuff, it didn't work. If you read the issues, it seems there are a fair amount of people having similar problems with this module. I suggest we work on something of higher priority, as getting layout and colours sorted in this is probably good enough
Explanation
I have set this up to be scalable - we need another pdf export in the matches index screen (screenshot below).
Dummy data is mapped over in the match trial page. This can be used to display results, but the same data also needs to be passed to the pdf through
PDFDownloadLink
, a button from '@react-pdf/renderer'. The data hitsPdfTemplate
, and the type prop passed in determines which layout template to handle the display of data.Todo / to bear in mind:
@wright1 this is nearly complete - just need to add the locations.
To register multiple font weights, i pulled in the
.ttf
files, giving a family name for each weight, as suggested here. Fonts are referenced in a similar way to images.@othman-shamla a dummy data structure is used here that should be shared with your latest piece of work - as this is pretty much the pdf equivalent.
I have an error in the console that we should try and figure out at some point: