This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { CssBaseline } from '@mui/material'
|
||||
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
||||
import { appWithTranslation } from 'next-i18next'
|
||||
import { useEffect } from 'react'
|
||||
// import ym from 'react-yandex-metrika'
|
||||
import withYM from 'next-ym'
|
||||
import Router from 'next/router'
|
||||
|
||||
import 'reset-css'
|
||||
import '../styles/global.scss'
|
||||
@@ -15,15 +15,6 @@ function App ({ Component, pageProps }) {
|
||||
}
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined' && process.env.NODE_ENV === 'production') {
|
||||
// const url = window.location.pathname + window.location.search
|
||||
// ym('hit', url)
|
||||
} else {
|
||||
console.log('Not in production, not sending Yandex Metrika hit')
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
@@ -34,4 +25,4 @@ function App ({ Component, pageProps }) {
|
||||
)
|
||||
}
|
||||
|
||||
export default appWithTranslation(App)
|
||||
export default withYM(process.env.YA_METRIKA_ID, Router)(appWithTranslation(App))
|
||||
|
||||
Reference in New Issue
Block a user