slate/pages/_app.js
jasonleyser 50ecf4496e Added Intercom back
adding intercom back into the app, dropdown menu and search modal
2021-07-14 16:08:09 -06:00

35 lines
1015 B
JavaScript

import App from "next/app";
import ThemeProvider from "~/components/system/ThemeProvider";
import * as React from "react";
import { Global } from "@emotion/react";
import { injectGlobalStyles, injectCodeBlockStyles } from "~/common/styles/global";
import { IntercomProvider } from 'react-use-intercom';
const INTERCOM_APP_ID = 'jwgbampk';
// NOTE(wwwjim):
// https://nextjs.org/docs/advanced-features/custom-app
function MyApp({ Component, pageProps }) {
return (
<ThemeProvider>
<React.Fragment>
<script src="//cdn.iframe.ly/embed.js" async></script>
<Global styles={injectGlobalStyles()} />
<Global styles={injectCodeBlockStyles()} />
<IntercomProvider appId={INTERCOM_APP_ID} autoBoot>
<Component {...pageProps} />
</IntercomProvider>
</React.Fragment>
</ThemeProvider>
);
}
MyApp.getInitialProps = async (appContext) => {
const appProps = await App.getInitialProps(appContext);
return { ...appProps };
};
export default MyApp;