Skip to content

Commit 8e20f01

Browse files
authored
Merge pull request #23 from powdr-labs:fix-mobile
Fix mobile layout
2 parents e13eaec + 0a34232 commit 8e20f01

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

app/layout.tsx

+7-9
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ export default function RootLayout({ children }: { children: React.ReactNode })
100100
<body className="min-h-screen bg-white pl-[calc(100vw-100%)] text-black antialiased dark:bg-gray-950 dark:text-white">
101101
<ThemeProviders>
102102
{/* <Analytics analyticsConfig={siteMetadata.analytics as AnalyticsConfig} /> */}
103-
<div className="flex min-h-screen flex-col">
104-
<SectionContainer>
105-
<SearchProvider searchConfig={siteMetadata.search as SearchConfig}>
106-
<Header />
107-
<main className="mb-12 flex-grow">{children}</main>
108-
</SearchProvider>
109-
</SectionContainer>
110-
<Footer />
111-
</div>
103+
<SectionContainer>
104+
<SearchProvider searchConfig={siteMetadata.search as SearchConfig}>
105+
<Header />
106+
<main className="mb-12 flex-grow">{children}</main>
107+
</SearchProvider>
108+
</SectionContainer>
109+
<Footer />
112110
</ThemeProviders>
113111
</body>
114112
</html>

components/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { PowdrLogo } from './powdrLogo'
33

44
export default function Footer() {
55
return (
6-
<footer className="mt-auto bg-[#1e1b4b] py-8 text-white">
7-
<div className="container mx-auto flex flex-col items-center">
6+
<footer className="mt-auto bg-[#1e1b4b] px-8 py-8 text-white">
7+
<div className="container mx-auto flex flex-col items-center text-center">
88
<PowdrLogo className="mb-4 h-24 w-auto text-white" />
99
<p className="mb-2 text-sm">
1010
© powdr labs GmbH {new Date().getFullYear()}-{new Date().getFullYear() + 1}. All Rights

components/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const Header = () => {
3232
))}
3333
</div>
3434
<SearchButton />
35-
<ThemeSwitch />
3635
<MobileNav />
36+
<ThemeSwitch />
3737
</div>
3838
</header>
3939
)

components/MobileNav.tsx

+24-6
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,25 @@ const MobileNav = () => {
2727
})
2828

2929
return (
30-
<>
31-
<button aria-label="Toggle Menu" onClick={onToggleNav} className="sm:hidden">
30+
<div className="sm:hidden">
31+
<nav
32+
// ref={navRef}
33+
// className="mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pl-12 pt-2 text-left"
34+
>
35+
{headerNavLinks.map((link) =>
36+
link.title === 'Home' ? null : (
37+
<Link
38+
key={link.title}
39+
href={link.href}
40+
className="mb-4 py-2 text-xl font-bold tracking-widest text-gray-900 outline outline-0 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
41+
onClick={onToggleNav}
42+
>
43+
{link.title}
44+
</Link>
45+
)
46+
)}
47+
</nav>
48+
{/* <button aria-label="Toggle Menu" onClick={onToggleNav} className="sm:hidden">
3249
<svg
3350
xmlns="http://www.w3.org/2000/svg"
3451
viewBox="0 0 20 20"
@@ -41,8 +58,9 @@ const MobileNav = () => {
4158
clipRule="evenodd"
4259
/>
4360
</svg>
44-
</button>
45-
<Transition appear show={navShow} as={Fragment} unmount={false}>
61+
</button> */}
62+
63+
{/* <Transition appear show={navShow} as={Fragment} unmount={false}>
4664
<Dialog as="div" onClose={onToggleNav} unmount={false}>
4765
<Transition.Child
4866
as={Fragment}
@@ -100,8 +118,8 @@ const MobileNav = () => {
100118
</Dialog.Panel>
101119
</Transition.Child>
102120
</Dialog>
103-
</Transition>
104-
</>
121+
</Transition> */}
122+
</div>
105123
)
106124
}
107125

0 commit comments

Comments
 (0)