consul/website/pages/_app.js

54 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-04-06 20:27:35 +00:00
import './style.css'
import '@hashicorp/platform-util/nprogress/style.css'
2020-05-19 18:32:38 +00:00
2020-04-06 20:27:35 +00:00
import Router from 'next/router'
2020-05-19 18:32:38 +00:00
import Head from 'next/head'
import NProgress from '@hashicorp/platform-util/nprogress'
import { ErrorBoundary } from '@hashicorp/platform-runtime-error-monitoring'
import createConsentManager from '@hashicorp/react-consent-manager/loader'
import useAnchorLinkAnalytics from '@hashicorp/platform-util/anchor-link-analytics'
2020-05-19 18:32:38 +00:00
import HashiHead from '@hashicorp/react-head'
import HashiStackMenu from '@hashicorp/react-hashi-stack-menu'
2020-04-28 17:53:30 +00:00
import AlertBanner from '@hashicorp/react-alert-banner'
2020-05-19 18:32:38 +00:00
import Footer from '../components/footer'
import ProductSubnav from '../components/subnav'
2020-04-28 17:53:30 +00:00
import alertBannerData, { ALERT_BANNER_ACTIVE } from '../data/alert-banner'
2020-04-06 20:27:35 +00:00
import Error from './_error'
2020-05-19 18:32:38 +00:00
NProgress({ Router })
const { ConsentManager, openConsentManager } = createConsentManager({
preset: 'oss',
2020-04-06 20:27:35 +00:00
})
export default function App({ Component, pageProps }) {
2020-05-19 18:32:38 +00:00
useAnchorLinkAnalytics()
return (
<ErrorBoundary FallbackComponent={Error}>
<HashiHead
is={Head}
title="Consul by HashiCorp"
siteName="Consul by HashiCorp"
description="Consul is a service networking solution to automate network configurations, discover services, and enable secure connectivity across any cloud or runtime."
image="https://www.consul.io/img/og-image.png"
icon={[{ href: '/favicon.ico' }]}
>
<meta
name="og:title"
property="og:title"
content="Consul by HashiCorp"
/>
</HashiHead>
{ALERT_BANNER_ACTIVE && (
<AlertBanner {...alertBannerData} product="consul" hideOnMobile />
2020-05-19 18:32:38 +00:00
)}
<HashiStackMenu />
2020-05-19 18:32:38 +00:00
<ProductSubnav />
<div className="content">
<Component {...pageProps} />
</div>
<Footer openConsentManager={openConsentManager} />
<ConsentManager />
</ErrorBoundary>
)
}