Skip to content

Commit

Permalink
#148 fix text layer
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Oct 11, 2023
1 parent 97866de commit 96aa91d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 32 deletions.
Binary file added front/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"react-hotkeys": "^2.0.0-pre9",
"react-intl": "^2.8.0",
"react-leaflet": "^2.6.0",
"react-pdf": "^7.0.2",
"react-pdf": "^7.5.0",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"react-scripts": "^5.0.1",
Expand Down
37 changes: 6 additions & 31 deletions front/src/Components/PDFViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ const PDFViewer = (props: PDFViewerProps & RouteComponentProps) => {
error={<PDFErrorComponent />}
pageIndex={pageNumber - 1}
width={drawer.width}
customTextRenderer={
currentSearchTerm &&
useHighlighter &&
makeTextRenderer(currentSearchTerm)
}
renderTextLayer={false}
// customTextRenderer={
// currentSearchTerm &&
// useHighlighter &&
// makeTextRenderer(currentSearchTerm)
// }
/>
</Document>
</div>
Expand Down Expand Up @@ -252,32 +253,6 @@ const PDFViewer = (props: PDFViewerProps & RouteComponentProps) => {
<Button onClick={setFillWidth} title="Scherm vullen (F)">
<FontAwesomeIcon icon={faExpand} />
</Button>
<Button
title={glossIsOpen ? "Sluit glossarium" : "Open glossarium"}
onClick={
glossIsOpen
? () => setGlossIsOpen(false)
: () => setGlossIsOpen(true)
}
>
<FontAwesomeIcon
// If text is selected, bounce this bad boy
className={
selectedText.length > 1 && !glossIsOpen ? "bounce" : ""
}
icon={faBook}
/>
</Button>
<Button
onClick={() => setHighlighter(!useHighlighter)}
title={
useHighlighter
? "Resultaten niet onderstrepen"
: "Resultaten onderstrepen"
}
>
<FontAwesomeIcon icon={faHighlighter} />
</Button>
</div>
</div>
)}
Expand Down

0 comments on commit 96aa91d

Please sign in to comment.