This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
MONGODB_URI=
|
MONGODB_URI=
|
||||||
|
YA_METRIKA_ID=
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ export default function Layout ({ children }) {
|
|||||||
<Head>
|
<Head>
|
||||||
<title>Warframe Center</title>
|
<title>Warframe Center</title>
|
||||||
<link rel='icon' href='/favicon.ico' />
|
<link rel='icon' href='/favicon.ico' />
|
||||||
<YMInitializer accounts={[87671663]} />
|
<YMInitializer
|
||||||
|
accounts={[Number(process.env.YA_METRIKA_ID)]}
|
||||||
|
options={{ webvisor: true, defer: true }}
|
||||||
|
version='2'
|
||||||
|
/>
|
||||||
</Head>
|
</Head>
|
||||||
<main>{children}</main>
|
<main>{children}</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { CssBaseline } from '@mui/material'
|
import { CssBaseline } from '@mui/material'
|
||||||
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
||||||
import { appWithTranslation } from 'next-i18next'
|
import { appWithTranslation } from 'next-i18next'
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
import ym from 'react-yandex-metrika'
|
||||||
|
|
||||||
import 'reset-css'
|
import 'reset-css'
|
||||||
import '../styles/global.scss'
|
import '../styles/global.scss'
|
||||||
@@ -13,6 +15,15 @@ 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 (
|
return (
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { Component } from 'react'
|
|
||||||
import { models } from 'shared-stuff'
|
import { models } from 'shared-stuff'
|
||||||
|
|
||||||
import dbConnect from '../../lib/dbConnect'
|
import dbConnect from '../../lib/dbConnect'
|
||||||
@@ -7,23 +6,16 @@ import dbConnect from '../../lib/dbConnect'
|
|||||||
import Hero from './Hero'
|
import Hero from './Hero'
|
||||||
import Table from './Table'
|
import Table from './Table'
|
||||||
|
|
||||||
export default class Home extends Component {
|
export default function Home ({ scanResults }) {
|
||||||
constructor ({ scanResults }) {
|
|
||||||
super()
|
|
||||||
this.scanResults = scanResults
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Hero />
|
<Hero />
|
||||||
<Table
|
<Table
|
||||||
scanResults={this.scanResults}
|
scanResults={scanResults}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export async function getServerSideProps ({ locale }) {
|
export async function getServerSideProps ({ locale }) {
|
||||||
await dbConnect()
|
await dbConnect()
|
||||||
|
|||||||
Reference in New Issue
Block a user