-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathLayoutWrapper.js
More file actions
73 lines (71 loc) · 2.47 KB
/
LayoutWrapper.js
File metadata and controls
73 lines (71 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import siteMetadata from '@/data/siteMetadata'
import headerNavLinks from '@/data/headerNavLinks'
import Logo from '@/data/logo.svg'
import Link from './Link'
import SectionContainer from './SectionContainer'
import Footer from './Footer'
import MobileNav from './MobileNav'
import ThemeSwitch from './ThemeSwitch'
import { Builder } from '@builder.io/react'
const LayoutWrapper = ({ children }) => {
return (
<SectionContainer>
<div className="flex h-screen flex-col justify-between">
<header className="mx-auto flex items-center justify-between py-10">
<div>
<Link href="/" aria-label={siteMetadata.headerTitle}>
<div className="flex items-center justify-between">
<div className="mr-3">
<Logo />
</div>
{typeof siteMetadata.headerTitle === 'string' ? (
<div className="hidden h-6 text-2xl font-semibold sm:block">
{siteMetadata.headerTitle}
</div>
) : (
siteMetadata.headerTitle
)}
</div>
</Link>
</div>
<div className="flex items-center text-base leading-5">
<div className="hidden sm:block">
{headerNavLinks.map((link) =>
link.external ? (
<a
href={link.href}
key={link.href}
target="_blank"
onClick={() => {
// Allow opening this from the Builder.io editor
if (Builder.isEditing) {
open(link.href, '_blank')
}
}}
className="p-1 font-medium text-primary-500 sm:p-4"
rel="noreferrer"
>
{link.title}
</a>
) : (
<Link
key={link.title}
href={link.href}
className="p-1 font-medium text-gray-900 dark:text-gray-100 sm:p-4"
>
{link.title}
</Link>
)
)}
</div>
<ThemeSwitch />
<MobileNav />
</div>
</header>
<main className="mx-auto mb-auto flex flex-col">{children}</main>
<Footer />
</div>
</SectionContainer>
)
}
export default LayoutWrapper