Skip to content

Commit 0f0419d

Browse files
author
Tair Asim
authored
Add Plausible (#98)
1 parent 1fb63ec commit 0f0419d

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

next.config.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/** @type {import('next').NextConfig} */
22

3-
module.exports = {
3+
// eslint-disable-next-line @typescript-eslint/no-var-requires
4+
const { withPlausibleProxy } = require('next-plausible')
5+
6+
module.exports = withPlausibleProxy()({
47
reactStrictMode: true,
58
webpack5: true,
69
serverRuntimeConfig: {
@@ -16,4 +19,4 @@ module.exports = {
1619

1720
return config
1821
},
19-
}
22+
})

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"lodash.debounce": "^4.0.8",
2828
"next": "12",
2929
"next-mdx-remote": "^3.0.8",
30+
"next-plausible": "^3.1.4",
3031
"next-themes": "^0.0.15",
3132
"react": "^17.0.2",
3233
"react-dom": "^17.0.2",

pages/_app.tsx

+13-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ReactElement, ReactNode } from 'react'
33
import { KBarProvider } from 'kbar'
44
import useActions from 'lib/useActions'
55
import type { NextPage } from 'next'
6+
import PlausibleProvider from 'next-plausible'
67
import { ThemeProvider } from 'next-themes'
78
import type { AppProps } from 'next/app'
89

@@ -30,16 +31,18 @@ const Main = ({ Component, pageProps }: AppPropsWithLayout) => {
3031
const getLayout = Component.getLayout ?? ((page) => page)
3132

3233
return (
33-
<ThemeProvider attribute="class">
34-
<SettingsProvider>
35-
<EthereumProvider>
36-
<KBarProvider actions={actions}>
37-
{getLayout(<Component {...pageProps} />)}
38-
<KBar />
39-
</KBarProvider>
40-
</EthereumProvider>
41-
</SettingsProvider>
42-
</ThemeProvider>
34+
<PlausibleProvider domain="evm.codes">
35+
<ThemeProvider attribute="class">
36+
<SettingsProvider>
37+
<EthereumProvider>
38+
<KBarProvider actions={actions}>
39+
{getLayout(<Component {...pageProps} />)}
40+
<KBar />
41+
</KBarProvider>
42+
</EthereumProvider>
43+
</SettingsProvider>
44+
</ThemeProvider>
45+
</PlausibleProvider>
4346
)
4447
}
4548

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -4176,6 +4176,11 @@ next-mdx-remote@^3.0.8:
41764176
esbuild "^0.12.9"
41774177
pkg-dir "^5.0.0"
41784178

4179+
next-plausible@^3.1.4:
4180+
version "3.1.4"
4181+
resolved "https://registry.yarnpkg.com/next-plausible/-/next-plausible-3.1.4.tgz#a386ff4e2327995cb4a1307e53e1b4af70817b52"
4182+
integrity sha512-NMLKJ0AKlKuvYU//RytyqSES5NtLRoH/ym3fCC02w2Ed1SrTgNRUrgpxyJrcguY/DYGPncQ3a0/nQ358vUTAwQ==
4183+
41794184
next-themes@^0.0.15:
41804185
version "0.0.15"
41814186
resolved "https://package-cluster.production.groovehq.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d"

0 commit comments

Comments
 (0)