mirror of
https://github.com/netbirdio/docs.git
synced 2026-05-02 15:26:36 +00:00
Add cookies popup (#690)
This commit is contained in:
@@ -15,6 +15,8 @@ import {dom} from "@fortawesome/fontawesome-svg-core";
|
||||
import {AnnouncementBannerProvider} from "@/components/announcement-banner/AnnouncementBannerProvider";
|
||||
import {ImageZoom} from "@/components/ImageZoom";
|
||||
import {MatomoTagManager} from "@/components/Matomo";
|
||||
import {CookieConsentProvider, useCookieConsent} from "@/components/cookie-consent/CookieConsentProvider";
|
||||
import {CookieConsent} from "@/components/cookie-consent/CookieConsent";
|
||||
|
||||
function onRouteChange() {
|
||||
useMobileNavigationStore.getState().close()
|
||||
@@ -23,12 +25,14 @@ function onRouteChange() {
|
||||
Router.events.on('routeChangeStart', onRouteChange)
|
||||
Router.events.on('hashChangeStart', onRouteChange)
|
||||
|
||||
export default function App({ Component, pageProps }) {
|
||||
function AppInner({ Component, pageProps }) {
|
||||
let router = useRouter()
|
||||
let tableOfContents = collectHeadings(pageProps.sections)
|
||||
let tableOfContents = collectHeadings(pageProps.sections)
|
||||
const { isAccepted } = useCookieConsent()
|
||||
|
||||
return (
|
||||
<>
|
||||
<MatomoTagManager />
|
||||
<MatomoTagManager consentGiven={isAccepted} />
|
||||
<Head>
|
||||
<style>{dom.css()}</style>
|
||||
{router.route.startsWith('/ipa') ?
|
||||
@@ -45,10 +49,19 @@ export default function App({ Component, pageProps }) {
|
||||
</AnnouncementBannerProvider>
|
||||
<ToastContainer />
|
||||
<ImageZoom />
|
||||
<CookieConsent />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default function App(props) {
|
||||
return (
|
||||
<CookieConsentProvider>
|
||||
<AppInner {...props} />
|
||||
</CookieConsentProvider>
|
||||
)
|
||||
}
|
||||
|
||||
function collectHeadings(sections, slugify = slugifyWithCounter()) {
|
||||
let output = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user