Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
fix: unable to scroll page when navigate via drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
1nayu committed Oct 7, 2024
1 parent e163a51 commit f59f99c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/(authenticated)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function RootLayout({
<CssBaseline/>
<Box sx={{ display: 'flex' }}>
<Navigation/>
<Stack minHeight="100lvh-8" width="100%" mt={8}>
<Stack minHeight="100lvh-8" width="100%" mt={8} overflow={"scrollable"}>
{children}
</Stack>
</Box>
Expand Down
14 changes: 8 additions & 6 deletions components/layout/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export const Navigation = () => {
const [isClosing, setIsClosing] = React.useState(false);

const handleDrawerClose = () => {
setIsClosing(true);
setMobileOpen(false);
if (mobileOpen) {
setIsClosing(true);
setMobileOpen(false);
}
}
const handleDrawerTransitionEnd = () => {
setIsClosing(false);
Expand All @@ -48,7 +50,7 @@ export const Navigation = () => {
sx={{py: buttonPadding, width: "100%", fontWeight: "600"}}
component={NextLink}
href={"/"}
onClick={handleDrawerToggle}
onClick={handleDrawerClose}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"}
alignItems="center">
Expand All @@ -65,7 +67,7 @@ export const Navigation = () => {
sx={{py: buttonPadding, width: "100%", fontWeight: "600"}}
component={NextLink}
href={"/"}
onClick={handleDrawerToggle}
onClick={handleDrawerClose}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"}
alignItems="center">
Expand Down Expand Up @@ -102,7 +104,7 @@ export const Navigation = () => {
sx={{py: buttonPadding, width: "100%", fontWeight: "600"}}
component={NextLink}
href={"/sports"}
onClick={handleDrawerToggle}
onClick={handleDrawerClose}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"}
alignItems="center">
Expand Down Expand Up @@ -170,7 +172,7 @@ export const Navigation = () => {
sx={{py: buttonPadding, width: "100%", fontWeight: "600"}}
component={NextLink}
href={"/roles"}
onClick={handleDrawerToggle}
onClick={handleDrawerClose}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"}
alignItems="center">
Expand Down

0 comments on commit f59f99c

Please sign in to comment.