2021-09-05 18:40:02 +02:00
|
|
|
import { useEffect } from 'react';
|
2021-08-01 13:19:54 +02:00
|
|
|
import type { AppProps } from 'next/app';
|
|
|
|
import { ChakraProvider } from '@chakra-ui/react';
|
2021-09-22 20:42:51 +02:00
|
|
|
import { Global, css } from '@emotion/react';
|
2021-08-29 21:29:14 +02:00
|
|
|
import 'prism-themes/themes/prism-shades-of-purple.css';
|
2021-09-22 20:42:51 +02:00
|
|
|
import 'focus-visible/dist/focus-visible';
|
2021-09-05 18:45:32 +02:00
|
|
|
import { roadmapTheme } from '../styles/theme';
|
2021-09-05 18:40:02 +02:00
|
|
|
import { firePageView } from '../lib/gtag';
|
2021-09-05 18:45:32 +02:00
|
|
|
import '../styles/carbon.css';
|
2021-09-05 21:58:44 +02:00
|
|
|
import { StickyBanner } from '../components/sticky-banner';
|
2021-08-01 13:08:35 +02:00
|
|
|
|
2021-09-22 20:42:51 +02:00
|
|
|
const GlobalStyles = css`
|
|
|
|
/*
|
|
|
|
This will hide the focus indicator if the
|
|
|
|
element receives focus via the mouse,
|
|
|
|
but it will still show up on keyboard focus.
|
|
|
|
*/
|
|
|
|
.js-focus-visible :focus:not([data-focus-visible-added]) {
|
|
|
|
outline: none;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
2021-08-01 13:08:35 +02:00
|
|
|
function MyApp({ Component, pageProps }: AppProps) {
|
2021-09-05 18:40:02 +02:00
|
|
|
useEffect(() => {
|
|
|
|
firePageView(window.location.pathname);
|
|
|
|
}, []);
|
|
|
|
|
2021-08-01 13:19:54 +02:00
|
|
|
return (
|
2021-08-01 18:37:32 +02:00
|
|
|
<ChakraProvider theme={roadmapTheme}>
|
2021-09-22 20:42:51 +02:00
|
|
|
<Global styles={GlobalStyles} />
|
2021-09-05 21:58:44 +02:00
|
|
|
<StickyBanner />
|
2021-08-01 13:19:54 +02:00
|
|
|
<Component {...pageProps} />
|
|
|
|
</ChakraProvider>
|
|
|
|
);
|
2021-08-01 13:08:35 +02:00
|
|
|
}
|
2021-08-01 13:19:54 +02:00
|
|
|
|
|
|
|
export default MyApp;
|