fix: wrong places and wrong strategies

This commit is contained in:
rizaldy 2024-01-31 03:26:54 +07:00
parent 24a6e5d568
commit 9258f93846
2 changed files with 26 additions and 22 deletions

View File

@ -1,5 +1,7 @@
import "../styles/globals.css";
import Script from "next/script";
import { Fragment } from "react";
import Navbar from "../components/Navbar";
@ -13,19 +15,29 @@ const Content = ({ children }) => (
</div>
);
const App = ({ Component, pageProps }) => (
<Fragment>
<Navbar name={config.navbar.logotype} logo={config.navbar.logo} />
<Content>
<Component {...pageProps} />
</Content>
<Footer
repo={config.footer.repo}
links={config.footer.links}
license={config.footer.license}
commitID={process.env.COMMIT_SHORT_SHA || "HEAD"}
/>
</Fragment>
);
const App = ({ Component, pageProps }) => {
console.log(process.env.UMAMI_ENABLED);
return (
<Fragment>
<Navbar name={config.navbar.logotype} logo={config.navbar.logo} />
<Content>
<Component {...pageProps} />
</Content>
<Footer
repo={config.footer.repo}
links={config.footer.links}
license={config.footer.license}
commitID={process.env.COMMIT_SHORT_SHA || "HEAD"}
/>
{process.env.UMAMI_ENABLED ? (
<Script
strategy="beforeInteractive"
src={process.env.UMAMI_SCRIPT_URL}
data-website-id={process.env.UMAMI_WEBSITE_ID}
/>
) : null}
</Fragment>
);
};
export default App;

View File

@ -1,5 +1,3 @@
import Script from "next/script";
import { Html, Head, Main, NextScript } from "next/document";
const Document = () => {
@ -9,12 +7,6 @@ const Document = () => {
<body>
<Main />
<NextScript />
{process.env.UMAMI_ENABLED === "true" ? (
<Script
src={process.env.UMAMI_SCRIPT_URL}
data-website-id={process.env.UMAMI_WEBSITE_ID}
/>
) : null}
</body>
</Html>
);