mirror of
https://github.com/brianlovin/security-checklist.git
synced 2026-03-11 08:55:31 +00:00
Update fathom
This commit is contained in:
parent
63a2dacec4
commit
3536b9da36
3 changed files with 13 additions and 13 deletions
|
|
@ -18,7 +18,7 @@
|
|||
"lint:staged": "lint-staged"
|
||||
},
|
||||
"dependencies": {
|
||||
"fathom-client": "^1.0.0",
|
||||
"fathom-client": "^2.0.2",
|
||||
"next": "^9.1.6",
|
||||
"next-seo": "^3.2.0",
|
||||
"react": "^16.12.0",
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import * as React from 'react'
|
||||
import App from 'next/app';
|
||||
import Fathom from 'fathom-client'
|
||||
import { trackPageview, load, setSiteId } from 'fathom-client'
|
||||
import Router from 'next/router'
|
||||
import Providers from '../components/Providers';
|
||||
|
||||
Router.events.on('routeChangeComplete', () => {
|
||||
Fathom.trackPageview()
|
||||
trackPageview()
|
||||
})
|
||||
|
||||
function FathomWrapper(props) {
|
||||
function FathomProvider(props) {
|
||||
React.useEffect(() => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Fathom.load();
|
||||
Fathom.setSiteId('ESMHTGZE');
|
||||
Fathom.trackPageview();
|
||||
load();
|
||||
setSiteId('ESMHTGZE');
|
||||
trackPageview();
|
||||
}
|
||||
}, [])
|
||||
return <div {...props} />
|
||||
|
|
@ -23,11 +23,11 @@ class MyApp extends App {
|
|||
render() {
|
||||
const { Component, pageProps } = this.props;
|
||||
return (
|
||||
<FathomWrapper>
|
||||
<FathomProvider>
|
||||
<Providers>
|
||||
<Component {...pageProps} />
|
||||
</Providers>
|
||||
</FathomWrapper>
|
||||
</FathomProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3822,10 +3822,10 @@ fastq@^1.6.0:
|
|||
dependencies:
|
||||
reusify "^1.0.0"
|
||||
|
||||
fathom-client@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-1.0.0.tgz#de3127a9555081983654375789e665cc2e938c74"
|
||||
integrity sha512-YUJJHGOm9KOIjoZDnQeCCPOKu28t6k+hPD49rGAV1/HTknAIDb8J2u5foPg2JgsWcB4ORvJjN/7xSTUPvRK4/Q==
|
||||
fathom-client@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-2.0.2.tgz#83c66b9c0111478ff75004563ea58f8dcf692c2d"
|
||||
integrity sha512-2OvYKIuuSKwx658rSPwTMDXmRLUdNh4N2KzQCUHJUTVaCdK1Tv49zeJd3ovgIeont/r+1wk/7Ri/sMzoHY5MXw==
|
||||
|
||||
fd-slicer@~1.0.1:
|
||||
version "1.0.1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue