diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d24fdfc..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged diff --git a/package.json b/package.json index c02f3c0..f8fae8c 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "lit": "^3.2.0", "million": "^3.1.11", "next": "14.2.5", + "next-umami": "^0.0.4", "notistack": "^3.0.1", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2093674..6391c18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,6 +68,9 @@ importers: next: specifier: 14.2.5 version: 14.2.5(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + next-umami: + specifier: ^0.0.4 + version: 0.0.4 notistack: specifier: ^3.0.1 version: 3.0.1(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1318,6 +1321,7 @@ packages: acorn-import-assertions@1.9.0: resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} + deprecated: package has been renamed to acorn-import-attributes peerDependencies: acorn: ^8 @@ -1920,6 +1924,7 @@ packages: eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -2630,6 +2635,9 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + next-umami@0.0.4: + resolution: {integrity: sha512-v/sXVwvy+sumq3jPRkjiv1Tf7nk1HQxAjyohrc+x65QI6v5vFK2NG3NyI+C7ML41dYHDPg+UswUDDZu0yeGUWg==} + next@14.2.5: resolution: {integrity: sha512-0f8aRfBVL+mpzfBjYfQuLWh2WyAwtJXCRfkPF4UJ5qd2YwrHczsrSzXU4tRMV0OAxR8ZJZWPFn6uhSC56UTsLA==} engines: {node: '>=18.17.0'} @@ -6226,6 +6234,8 @@ snapshots: neo-async@2.6.2: {} + next-umami@0.0.4: {} + next@14.2.5(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.5 diff --git a/src/app/_libs/umami-provider.tsx b/src/app/_libs/umami-provider.tsx new file mode 100644 index 0000000..aa489bd --- /dev/null +++ b/src/app/_libs/umami-provider.tsx @@ -0,0 +1,23 @@ +import UmamiProvider from 'next-umami'; +import { ReactNode } from 'react'; + +interface UmamiProviderProps { + children: ReactNode; +} + +export default function WPNUmamiProvider({ children }: UmamiProviderProps) {\ + const websiteId = process.env.NEXT_PUBLIC_UMAMI_ID; +\ + if (!websiteId) { + return <>{children}; + } +\ + return ( + + {children} + + ); +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index bd5eea4..8dba8c5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,6 +10,7 @@ import Footer from './_libs/components/footer'; import * as Fonts from '@/app/_libs/fonts/fonts'; import { Analytics } from '@vercel/analytics/react'; import Script from 'next/script'; +import WPNUmamiProvider from './_libs/umami-provider'; const APP_NAME = APP_MANIFEST.name; const APP_DEFAULT_TITLE = APP_MANIFEST.name; @@ -136,48 +137,50 @@ export default function RootLayout({ }} > -
-
-
-
-
-
-
-
-
-
- {children} - {modal} -
-
+ +
+
+
+
+
+
+
+
+
+
+ {children} + {modal} +
+
+
-
-
-