From d2f30a156932e2f271e6235b93339c4a2a2f5c9d Mon Sep 17 00:00:00 2001 From: RKWojs Date: Wed, 20 Apr 2022 14:34:09 +0200 Subject: [PATCH] tagging release w.t.f. --- package-lock.json | 15 +++++++++++++++ package.json | 1 + pages/_app.js | 8 ++++++++ pages/index.js | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 5d318cb..99ad929 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "name": "wastpol", "dependencies": { + "@socialgouv/matomo-next": "^1.3.0", "@supercharge/request-ip": "^1.1.2", "axios": "^0.26.0", "child_process": "^1.0.2", @@ -486,6 +487,14 @@ "react": ">=16.3" } }, + "node_modules/@socialgouv/matomo-next": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@socialgouv/matomo-next/-/matomo-next-1.3.0.tgz", + "integrity": "sha512-1EWGFre4CudvcJPIaLYyAwHsGk8mMK5/IKztEIaU14uUifv117dlIJmcpJIVEow70AMY1VqRHh1x5z7Dx+H7dQ==", + "peerDependencies": { + "next": ">= 9.5.5" + } + }, "node_modules/@supercharge/request-ip": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@supercharge/request-ip/-/request-ip-1.1.2.tgz", @@ -6900,6 +6909,12 @@ "prop-types": "^15.5.7" } }, + "@socialgouv/matomo-next": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@socialgouv/matomo-next/-/matomo-next-1.3.0.tgz", + "integrity": "sha512-1EWGFre4CudvcJPIaLYyAwHsGk8mMK5/IKztEIaU14uUifv117dlIJmcpJIVEow70AMY1VqRHh1x5z7Dx+H7dQ==", + "requires": {} + }, "@supercharge/request-ip": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@supercharge/request-ip/-/request-ip-1.1.2.tgz", diff --git a/package.json b/package.json index d7cf738..829a088 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "deploy": "git pull && npm i && next build && pm2 restart kroj" }, "dependencies": { + "@socialgouv/matomo-next": "^1.3.0", "@supercharge/request-ip": "^1.1.2", "axios": "^0.26.0", "child_process": "^1.0.2", diff --git a/pages/_app.js b/pages/_app.js index 82c9fef..7b17dd9 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,11 +1,19 @@ import '../styles/globals.css' import { SessionProvider } from "next-auth/react" import Head from "next/head"; +import { useEffect } from "react"; +import { init } from "@socialgouv/matomo-next"; + +const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL; +const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID; function MyApp({ Component, pageProps: { session, ...pageProps }, }) { + useEffect(() => { + init({ url: MATOMO_URL, siteId: MATOMO_SITE_ID }); + }, []); return ( diff --git a/pages/index.js b/pages/index.js index 14d3f25..5d0f368 100644 --- a/pages/index.js +++ b/pages/index.js @@ -14,7 +14,7 @@ export default function Home() { const { data: session } = useSession(); const [selectedIndex, setSelectedIndex] = useState(0); const [tabs] = useState(["auto", "manual"]); - const [realTabs] = useState([Generator, Manual]); + //const [realTabs] = useState([Generator, Manual]); if (session) { return (