Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

_app.js

55 lines1.4 KB

1import React from 'react'
2import '@docsearch/react/dist/style.css'
3import '../styles/index.css'
4import Head from 'next/head'
5import { SearchProvider } from 'components/useSearch'
6​
7function loadScript(src, attrs = {}) {
8 if (typeof document !== 'undefined') {
9 const script = document.createElement('script')
10 script.async = true
11 script.defer = true
12 Object.keys(attrs).forEach((attr) => script.setAttribute(attr, attrs[attr]))
13 script.src = src
14 document.body.appendChild(script)
15 }
17​
18function MyApp({ Component, pageProps }) {
19 React.useEffect(() => {
20 loadScript('https://buttons.github.io/buttons.js')
21 }, [])
22​
23 return (
24 <>
25 <Head>
26 <link
27 href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
28 rel="stylesheet"
29 />
30 <style
31 dangerouslySetInnerHTML={{
32 __html: `
33 @media (max-width: 390px) {
34 .formkit-slide-in {
35 display: none;
36 }
37 }
38 @media (max-height: 740px) {
39 .formkit-slide-in {
40 display: none;
41 }
42 }
43 `,
44 }}
45 />
46 </Head>
47 <img src="https://static.scarf.sh/a.png?x-pxid=c26c2c2e-bc50-4e9e-9909-aeaba8968d45" />
48 <SearchProvider>
49 <Component {...pageProps} />
50 </SearchProvider>
51 </>
52 )
54​
55export default MyApp