diff --git a/layouts/PrintSlide.jsx b/layouts/PrintSlide.jsx index 27b57574..8ebedcd1 100644 --- a/layouts/PrintSlide.jsx +++ b/layouts/PrintSlide.jsx @@ -47,7 +47,7 @@ export default dynamic(() => Promise.resolve(PrintSlide), { }); function PrintSlide({ children, next }) { - console.log('PrintSlide:children : ', children) + // console.log('PrintSlide:children : ', children) let generatedSlides = []; let generatorCount = 0; // Filter down children by only Slides diff --git a/pages/files/[format]/[file].js b/pages/files/[format]/[file].js index 00591577..68ed15f2 100644 --- a/pages/files/[format]/[file].js +++ b/pages/files/[format]/[file].js @@ -15,6 +15,7 @@ import fs from 'fs' import path from 'path' import Head from 'next/head'; import Script from 'next/script'; +import dynamic from 'next/dynamic' const glob = require('glob') @@ -126,7 +127,11 @@ export async function getStaticProps(context) { } } -export default function Pad({ source, format }) { +export default dynamic(() => Promise.resolve(Pad), { + ssr: false, +}); + +function Pad({ source, format }) { const mdxContainer = useRef(null); const previewContainer = useRef(null); let contentMdx = ``; @@ -136,7 +141,7 @@ export default function Pad({ source, format }) { contentMdx = `${mdxContainer.current?.innerHTML}`; paged .preview(contentMdx, - [], + ['/pdf.css'], previewContainer.current ) .then((flow) => { @@ -159,7 +164,7 @@ export default function Pad({ source, format }) { return ( <> - + {/* */}
{/* style={{ display: 'none' }}> */} diff --git a/pages/files/[format]/pdf.module.css b/public/pdf.css similarity index 100% rename from pages/files/[format]/pdf.module.css rename to public/pdf.css diff --git a/tsconfig.json b/tsconfig.json index 503622e0..ac36717c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,8 @@ { "name": "next" } - ] + ], + "incremental": true }, "include": [ "next-env.d.ts", @@ -38,4 +39,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +}