Skip to content

Commit c52ca6a

Browse files
authored
Merge pull request #42 from oasisprotocol/mz/mobile
Tweak layout component
2 parents e93cffa + 26766c2 commit c52ca6a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/ui/layout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { FC, PropsWithChildren, ReactNode } from 'react'
22
import { SidebarProvider, SidebarTrigger } from './sidebar'
33
import { useIsMobile } from '../../hooks'
44
import { Separator } from './separator'
5+
import { cn } from '../../lib/utils'
56

67
const Header: FC<PropsWithChildren> = ({ children }) => (
7-
<header className="mt-12 md:mt-0 sticky md:static z-50 top-0">
8+
<header className="mt-0 sticky md:static z-50 top-0">
89
<nav className="md:h-16 px-3 md:px-6 py-2.5 bg-background border-b border-border shadow-sm flex items-center">
910
<div className="w-full max-w-[96rem] mx-auto flex">{children}</div>
1011
</nav>
@@ -44,6 +45,7 @@ interface LayoutProps {
4445
headerBreadcrumbsContent?: ReactNode
4546
footerContent?: ReactNode
4647
sidebar?: ReactNode
48+
className?: string
4749
}
4850

4951
export const Layout: FC<PropsWithChildren<LayoutProps>> = ({
@@ -52,11 +54,12 @@ export const Layout: FC<PropsWithChildren<LayoutProps>> = ({
5254
headerBreadcrumbsContent,
5355
footerContent,
5456
sidebar,
57+
className,
5558
}) => {
5659
const isMobile = useIsMobile()
5760

5861
const layoutContent = (
59-
<div className="w-full max-w-[96rem] mx-auto flex flex-col min-h-[800px] md:max-h-dvh">
62+
<div className={cn('w-full max-w-[96rem] mx-auto flex flex-col min-h-[800px] md:max-h-dvh', className)}>
6063
{headerContent && <Header>{headerContent}</Header>}
6164

6265
{isMobile && (

0 commit comments

Comments
 (0)