Files
warframe-center/app/pages/_app.js
anatolykopyl ad10f35e19
All checks were successful
continuous-integration/drone/push Build is passing
Disable ya metrika
2022-07-05 02:34:43 +03:00

38 lines
947 B
JavaScript

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 'reset-css'
import '../styles/global.scss'
import Layout from '../components/layout'
function App ({ Component, pageProps }) {
const theme = createTheme({
palette: {
mode: 'light'
}
})
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 />
<Layout>
<Component {...pageProps} />
</Layout>
</ThemeProvider>
)
}
export default appWithTranslation(App)