Skip to content

Build your personal knowledge base with Trilium Notes

fix(pdf): annotation icons not showing

Elian Doran1184cd6fafb7
diff --git a/apps/client/src/widgets/react/Icon.tsx b/apps/client/src/widgets/react/Icon.tsx
index 4bae69c460..1490e024c4 100644
--- a/apps/client/src/widgets/react/Icon.tsx
+++ b/apps/client/src/widgets/react/Icon.tsx
@@ -1,7 +1,7 @@
import clsx from "clsx";
import { HTMLAttributes } from "preact";
-interface IconProps extends Pick<HTMLAttributes<HTMLSpanElement>, "className" | "onClick" | "title"> {
+interface IconProps extends Pick<HTMLAttributes<HTMLSpanElement>, "className" | "onClick" | "title" | "style"> {
icon?: string;
className?: string;
}
diff --git a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
index ebabc1a974..0689a272f2 100644
--- a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
+++ b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
@@ -31,10 +31,9 @@
border-bottom: none;
}
-.pdf-annotation-icon {
+.pdf-annotation-item .tn-icon {
flex-shrink: 0;
- font-size: 16px;
- padding-top: 1px;
+ font-size: 18px;
}
.pdf-annotation-info {
diff --git a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
index 54354388ea..a81a4dc50d 100644
--- a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
+++ b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
@@ -8,7 +8,7 @@ import RightPanelWidget from "../RightPanelWidget";
const TYPE_ICONS: Record<string, string> = {
text: "bx bxs-comment-detail",
freetext: "bx bx-text",
- highlight: "bx bxs-highlight",
+ highlight: "bx bx-highlight",
underline: "bx bx-underline",
squiggly: "bx bx-water",
strikeout: "bx bx-strikethrough",
@@ -82,9 +82,7 @@ function PdfAnnotationItem({
return (
<div className="pdf-annotation-item" onClick={() => onNavigate(annotation.pageNumber)}>
- <div className="pdf-annotation-icon" style={annotation.color ? { color: annotation.color } : undefined}>
- <Icon icon={icon} />
- </div>
+ <Icon icon={icon} style={annotation.color ? { color: annotation.color } : undefined} />
<div className="pdf-annotation-info">
{annotation.highlightedText && (
<div className="pdf-annotation-highlighted-text">{annotation.highlightedText}</div>