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 "../styles/globals.css";
import Script from "next/script";
import { Fragment } from "react"; import { Fragment } from "react";
import Navbar from "../components/Navbar"; import Navbar from "../components/Navbar";
@ -13,19 +15,29 @@ const Content = ({ children }) => (
</div> </div>
); );
const App = ({ Component, pageProps }) => ( const App = ({ Component, pageProps }) => {
<Fragment> console.log(process.env.UMAMI_ENABLED);
<Navbar name={config.navbar.logotype} logo={config.navbar.logo} /> return (
<Content> <Fragment>
<Component {...pageProps} /> <Navbar name={config.navbar.logotype} logo={config.navbar.logo} />
</Content> <Content>
<Footer <Component {...pageProps} />
repo={config.footer.repo} </Content>
links={config.footer.links} <Footer
license={config.footer.license} repo={config.footer.repo}
commitID={process.env.COMMIT_SHORT_SHA || "HEAD"} links={config.footer.links}
/> license={config.footer.license}
</Fragment> 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; export default App;

View File

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