Fix TypeScript errors in pages dir

Idk why Next made me these files in a way that created React errors but ok! Maybe it was because we didn't have `pages` in the `includes`, so my editor was using the default tsconfig instead of this one?
This commit is contained in:
Emi Matchu 2022-09-14 18:04:10 -07:00
parent aceb881b7c
commit 26d7f4220a
4 changed files with 62 additions and 21 deletions

View file

@ -10,6 +10,6 @@ import dynamic from "next/dynamic";
// below removed
const NextIndexWrapper = dynamic(() => import("../src"), { ssr: false });
export default function Page(props) {
export default function Page(props: any) {
return <NextIndexWrapper {...props} />;
}

View file

@ -1,14 +1,15 @@
import Head from 'next/head'
import Head from "next/head";
import type { AppProps } from "next/app";
export default function MyApp({ Component, pageProps}) {
export default function DTIApp({ Component, pageProps }: AppProps) {
return (
<>
<Head>
<title>Dress to Impress</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Component {...pageProps} />
</>
)
);
}

View file

@ -1,4 +1,4 @@
import Document, { Html, Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from "next/document";
class MyDocument extends Document {
render() {
@ -6,11 +6,28 @@ class MyDocument extends Document {
<Html lang="en">
<Head>
<meta charSet="utf-8" />
<link rel="icon" type="image/png" sizes="32x32" href={`${process.env.PUBLIC_URL}/favicon-32x32.png`} />
<link rel="icon" type="image/png" sizes="16x16" href={`${process.env.PUBLIC_URL}/favicon-16x16.png`} />
<link
rel="icon"
type="image/png"
sizes="32x32"
href={`${process.env.PUBLIC_URL}/favicon-32x32.png`}
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href={`${process.env.PUBLIC_URL}/favicon-16x16.png`}
/>
<meta name="theme-color" content="#000000" />
<link rel="apple-touch-icon" sizes="180x180" href={`${process.env.PUBLIC_URL}/apple-touch-icon.png`} />
<style type="text/css" dangerouslySetInnerHTML={{ __html: `
<link
rel="apple-touch-icon"
sizes="180x180"
href={`${process.env.PUBLIC_URL}/apple-touch-icon.png`}
/>
<style
type="text/css"
dangerouslySetInnerHTML={{
__html: `
/* A font by Jos Buivenga (exljbris) -> www.exljbris.com */
@font-face {
font-family: "Delicious";
@ -25,11 +42,33 @@ class MyDocument extends Document {
font-weight: 800 1000;
src: url(/fonts/Delicious-Heavy.otf);
}
` }} />
<script async="" defer="" data-domain="impress-2020.openneo.net" src="https://plausible.io/js/plausible.js" dangerouslySetInnerHTML={{ __html: `` }} />
<link rel="preload" href="/fonts/Delicious-Heavy.otf" type="font/otf" as="font" crossOrigin="" />
<link rel="preload" href="/fonts/Delicious-Bold.otf" type="font/otf" as="font" crossOrigin="" />
<script dangerouslySetInnerHTML={{ __html: `
`,
}}
/>
<script
async
defer
data-domain="impress-2020.openneo.net"
src="https://plausible.io/js/plausible.js"
dangerouslySetInnerHTML={{ __html: `` }}
/>
<link
rel="preload"
href="/fonts/Delicious-Heavy.otf"
type="font/otf"
as="font"
crossOrigin=""
/>
<link
rel="preload"
href="/fonts/Delicious-Bold.otf"
type="font/otf"
as="font"
crossOrigin=""
/>
<script
dangerouslySetInnerHTML={{
__html: `
// HACK: This is copy-pasted output from Chakra's <ColorModeScript />. It
// initializes our color mode to match the system color mode. The
// component is built for a special Document element like in
@ -62,18 +101,19 @@ class MyDocument extends Document {
root.style.setProperty("--chakra-ui-color-mode", colorMode);
}
})("system");
` }} />
`,
}}
/>
<noscript>You need to enable JavaScript to run this app.</noscript>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
);
}
}
export default MyDocument
export default MyDocument;

View file

@ -24,6 +24,6 @@
"module": "commonjs"
}
},
"include": ["src"],
"include": ["src", "pages"],
"exclude": ["node_modules"]
}