mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
add first version of tailwind docs
This commit is contained in:
40
src/pages/_app.jsx
Normal file
40
src/pages/_app.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import Head from 'next/head'
|
||||
import { Router, useRouter } from 'next/router'
|
||||
import { MDXProvider } from '@mdx-js/react'
|
||||
|
||||
import { Layout } from '@/components/Layout'
|
||||
import * as mdxComponents from '@/components/mdx'
|
||||
import { useMobileNavigationStore } from '@/components/MobileNavigation'
|
||||
|
||||
import '@/styles/tailwind.css'
|
||||
import 'focus-visible'
|
||||
|
||||
function onRouteChange() {
|
||||
useMobileNavigationStore.getState().close()
|
||||
}
|
||||
|
||||
Router.events.on('routeChangeStart', onRouteChange)
|
||||
Router.events.on('hashChangeStart', onRouteChange)
|
||||
|
||||
export default function App({ Component, pageProps }) {
|
||||
let router = useRouter()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
{router.pathname === '/' ? (
|
||||
<title>NetBird Docs</title>
|
||||
) : (
|
||||
router.pathname.startsWith('/docs') ?
|
||||
<title>{`${pageProps.title} - NetBird Docs`}</title> : <title>{`${pageProps.title} - NetBird API`}</title>
|
||||
)}
|
||||
<meta name="description" content={pageProps.description} />
|
||||
</Head>
|
||||
<MDXProvider components={mdxComponents}>
|
||||
<Layout {...pageProps}>
|
||||
<Component {...pageProps} />
|
||||
</Layout>
|
||||
</MDXProvider>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user