Skip to content

Commit

Permalink
feat: make screen non-scrollable in mobile view when sidebar is open (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DevarajuAlugolu authored Aug 30, 2023
1 parent 0bbc66a commit 96c989c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion layouts/GeneralLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@ import { Header } from 'components/Header/Header'
import { Aside } from 'components/Aside/Aside'
import { SkipLink } from 'components/SkipLink/SkipLink'

import { useContext } from 'react'
import { IContext } from 'types'
import { GlobalContext } from 'context/GlobalContext'

const GeneralLayout = ({ children }: { children: ReactNode }) => {
const { sidebar } = useContext<IContext>(GlobalContext)

return (
<>
<SkipLink />
<Header />
<SideNavbar />
<div className="row-start-2 row-end-3 min-h-[100vh-72px] w-full bg-gray-100 dark:bg-[#101623]">
<div
className={`row-start-2 row-end-3 min-h-[100vh-72px] w-full bg-gray-100 dark:bg-[#101623] ${
sidebar ? 'max-[1024px]:overflow-hidden' : ''
}`}
>
<nav>
<Aside />
</nav>
Expand Down

1 comment on commit 96c989c

@vercel
Copy link

@vercel vercel bot commented on 96c989c Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.