48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
import SkipLink from "../components/skiplink";
|
|
import { Tracking, TrackingNoScript } from "../components/tracking";
|
|
//import basicAuthMiddleware from "nextjs-basic-auth-middleware";
|
|
|
|
class MyDocument extends Document {
|
|
// static async getInitialProps(ctx) {
|
|
// const initialProps = await Document.getInitialProps(ctx);
|
|
// if (ctx.req && ctx.res) {
|
|
// await basicAuthMiddleware(ctx.req, ctx.res, {
|
|
// users: [
|
|
// {
|
|
// name: "rehab",
|
|
// password: "preventTesting",
|
|
// },
|
|
// ],
|
|
// });
|
|
// }
|
|
// return { ...initialProps };
|
|
// }
|
|
|
|
render() {
|
|
const googleTagManagerID = process.env.GOOGLE_TAG_MANAGER || null;
|
|
|
|
return (
|
|
<Html lang="en">
|
|
<Head>
|
|
<Tracking googleTagManagerID={googleTagManagerID} />
|
|
</Head>
|
|
<body className="js-enabled">
|
|
<TrackingNoScript googleTagManagerID={googleTagManagerID} />
|
|
|
|
{!process.browser && (
|
|
<script>
|
|
window.switchDomain = `{process.env.I18N_DOMAIN}`
|
|
</script>
|
|
)}
|
|
<SkipLink />
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default MyDocument;
|