Skip to content

Commit

Permalink
refactor: pdf viewer components
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Nov 12, 2024
1 parent 83332c4 commit 06f7db3
Show file tree
Hide file tree
Showing 18 changed files with 576 additions and 415 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"peerDependencies": {
"@blocksuite/affine": "*",
"@blocksuite/icons": "*"
"@blocksuite/icons": "2.1.67"
},
"dependencies": {
"@affine/cli": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ErrorBase = ({
buttons = [],
}: ErrorBaseProps) => {
return (
<div className={clsx([styles.body, styles.error])}>
<div className={clsx([styles.viewer, styles.error])}>
{icon}
<h3 className={styles.errorTitle}>{title}</h3>
<p className={styles.errorMessage}>{subtitle}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const AttachmentViewer = ({ model }: AttachmentViewerProps) => {
return (
<div className={styles.viewerContainer}>
<Titlebar {...props} />
{props.isPDF ? (
{model.type.endsWith('pdf') ? (
<AttachmentPreviewErrorBoundary>
<PDFViewer {...props} />
</AttachmentPreviewErrorBoundary>
Expand All @@ -39,7 +39,7 @@ export const AttachmentViewerView = ({ model }: AttachmentViewerProps) => {
<Titlebar {...props} />
</ViewHeader>
<ViewBody>
{props.isPDF ? (
{model.type.endsWith('pdf') ? (
<AttachmentPreviewErrorBoundary>
<PDFViewer {...props} />
</AttachmentPreviewErrorBoundary>
Expand Down
Loading

0 comments on commit 06f7db3

Please sign in to comment.