Skip to content

Commit 62ca968

Browse files
committed
fix: use native pdf viewer to remove google docs redirect button
1 parent fd4e03b commit 62ca968

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

public/sw.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/public/FilePreviewModal.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,21 @@ export default function FilePreviewModal({ file, onClose }: FilePreviewModalProp
279279
/>
280280
)}
281281

282-
{(isPdf || isOfficeDoc) && (
282+
{isPdf && (
283+
<iframe
284+
src={file.fileUrl}
285+
style={{
286+
width: "100%",
287+
height: "100%",
288+
border: "none",
289+
background: "white",
290+
borderRadius: "8px",
291+
boxShadow: "0 20px 50px rgba(0,0,0,0.5)"
292+
}}
293+
/>
294+
)}
295+
296+
{isOfficeDoc && (
283297
<iframe
284298
src={`https://docs.google.com/viewer?url=${encodeURIComponent(file.fileUrl)}&embedded=true`}
285299
style={{

0 commit comments

Comments
 (0)