This commit is contained in:
Mihajlo Medjedovic
2024-06-05 15:53:46 +02:00
commit fd510b88c4
270 changed files with 27578 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import React, { useEffect } from 'react'
import { PageProps } from 'gatsby'
import Navibar from './navibar'
import HeroSection from './herosection'
import Footer from './footer'
type DataProps = {
children?: React.ReactNode
heroSection: boolean
}
const Layout: React.FC<PageProps<DataProps>> = ({
location,
children,
heroSection = true,
heading,
desc
}) => {
useEffect(() => {
if (document.querySelector('script[data-name="kwes-script"]')) return
const kwesScript = document.createElement('script')
kwesScript.setAttribute('rel', 'noopener')
kwesScript.setAttribute('src', 'https://kwes.io/v2/kwes-script.js')
kwesScript.setAttribute('data-name', 'kwes-script')
document.head.appendChild(kwesScript)
})
return (
<>
<Navibar location={location} />
{heroSection && (
<HeroSection location={location} heading={heading} desc={desc} />
)}
{children}
<Footer />
</>
)
}
export default Layout