2020-01-18 00:18:09 +00:00
import './style.css'
2021-07-27 22:43:40 +00:00
import '@hashicorp/platform-util/nprogress/style.css'
2020-05-21 17:18:17 +00:00
2020-01-18 00:18:09 +00:00
import Router from 'next/router'
2020-03-30 17:30:56 +00:00
import Head from 'next/head'
2021-12-15 15:32:45 +00:00
import rivetQuery from '@hashicorp/nextjs-scripts/dato/client'
2021-07-27 22:43:40 +00:00
import { ErrorBoundary } from '@hashicorp/platform-runtime-error-monitoring'
import createConsentManager from '@hashicorp/react-consent-manager/loader'
2022-01-26 21:17:26 +00:00
import localConsentManagerServices from 'lib/consent-manager-services'
2021-07-27 22:43:40 +00:00
import NProgress from '@hashicorp/platform-util/nprogress'
2021-10-28 19:44:56 +00:00
import useFathomAnalytics from '@hashicorp/platform-analytics'
2021-07-27 22:43:40 +00:00
import useAnchorLinkAnalytics from '@hashicorp/platform-util/anchor-link-analytics'
2020-03-30 17:30:56 +00:00
import HashiHead from '@hashicorp/react-head'
2020-01-18 00:18:09 +00:00
import Error from './_error'
2021-01-11 16:17:03 +00:00
import AlertBanner from '@hashicorp/react-alert-banner'
import alertBannerData , { ALERT _BANNER _ACTIVE } from '../data/alert-banner'
2021-12-15 15:32:45 +00:00
import StandardLayout from 'layouts/standard'
2020-01-18 00:18:09 +00:00
2020-05-21 17:18:17 +00:00
NProgress ( { Router } )
2021-12-15 15:32:45 +00:00
const { ConsentManager } = createConsentManager ( {
2020-05-21 17:18:17 +00:00
preset : 'oss' ,
2022-01-26 21:17:26 +00:00
otherServices : [ ... localConsentManagerServices ] ,
2020-01-18 00:18:09 +00:00
} )
2021-12-15 15:32:45 +00:00
export default function App ( { Component , pageProps , layoutData } ) {
2021-10-28 19:44:56 +00:00
useFathomAnalytics ( )
2020-05-21 17:18:17 +00:00
useAnchorLinkAnalytics ( )
2020-01-18 00:18:09 +00:00
2021-12-15 15:32:45 +00:00
const Layout = Component . layout ? ? StandardLayout
2020-05-21 17:18:17 +00:00
return (
< ErrorBoundary FallbackComponent = { Error } >
< HashiHead
is = { Head }
title = "Vault by HashiCorp"
siteName = "Vault by HashiCorp"
description = "Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. Vault handles leasing, key revocation, key rolling, auditing, and provides secrets as a service through a unified API."
image = "https://www.vaultproject.io/img/og-image.png"
icon = { [
{
2021-10-28 19:44:56 +00:00
href : 'https://www.datocms-assets.com/2885/1597163356-vault-favicon.png?h=16&w=16' ,
2020-05-21 17:18:17 +00:00
type : 'image/png' ,
sizes : '16x16' ,
} ,
{
2021-10-28 19:44:56 +00:00
href : 'https://www.datocms-assets.com/2885/1597163356-vault-favicon.png?h=32&w=32' ,
2020-05-21 17:18:17 +00:00
type : 'image/png' ,
sizes : '32x32' ,
} ,
{
2021-10-28 19:44:56 +00:00
href : 'https://www.datocms-assets.com/2885/1597163356-vault-favicon.png?h=96&w=96' ,
2020-05-21 17:18:17 +00:00
type : 'image/png' ,
sizes : '96x96' ,
} ,
{
2021-10-28 19:44:56 +00:00
href : 'https://www.datocms-assets.com/2885/1597163356-vault-favicon.png?h=192&w=192' ,
2020-05-21 17:18:17 +00:00
type : 'image/png' ,
sizes : '192x192' ,
} ,
] }
/ >
2021-01-11 16:17:03 +00:00
{ ALERT _BANNER _ACTIVE && (
2021-08-20 16:20:18 +00:00
< AlertBanner { ... alertBannerData } product = "vault" hideOnMobile / >
2021-01-11 16:17:03 +00:00
) }
2021-12-15 15:32:45 +00:00
< Layout { ... ( layoutData && { data : layoutData } ) } >
< Component { ... pageProps } / >
< / L a y o u t >
2021-10-07 15:23:19 +00:00
< ConsentManager className = "g-consent-manager" / >
2020-05-21 17:18:17 +00:00
< / E r r o r B o u n d a r y >
)
}
2021-12-15 15:32:45 +00:00
App . getInitialProps = async ( { Component , ctx } ) => {
const layoutQuery = Component . layout
? Component . layout ? . rivetParams ? ? null
: StandardLayout . rivetParams
const layoutData = layoutQuery ? await rivetQuery ( layoutQuery ) : null
let pageProps = { }
if ( Component . getInitialProps ) {
pageProps = await Component . getInitialProps ( ctx )
}
return { pageProps , layoutData }
}