Skip to content

Commit 31cd16c

Browse files
authored
Merge pull request #162 from boostcampwm-2024/bug-fe-#161
사이드바에 ScrollWrapper 적용
2 parents 5de1374 + 18665af commit 31cd16c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

frontend/src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import HoverTrigger from "./components/HoverTrigger";
55
import EditorView from "./components/EditorView";
66
import SideWrapper from "./components/layout/SideWrapper";
77
import Canvas from "./components/canvas";
8+
import ScrollWrapper from "./components/layout/ScrollWrapper";
89

910
const queryClient = new QueryClient();
1011

@@ -17,7 +18,9 @@ function App() {
1718
</SideWrapper>
1819
<Canvas className="z-0 h-full w-full" />
1920
<HoverTrigger className="absolute inset-0 z-20 w-64">
20-
<Sidebar />
21+
<ScrollWrapper height={"h-[720px]"} className="overflow-x-clip">
22+
<Sidebar />
23+
</ScrollWrapper>
2124
</HoverTrigger>
2225
</div>
2326
</QueryClientProvider>

frontend/src/components/layout/ScrollWrapper.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ type ScrollWrapperProps = {
55
width?: Tailwindest["width"];
66
height?: Tailwindest["height"];
77
children: React.ReactNode;
8+
className?: string;
89
};
910

1011
export default function ScrollWrapper({
1112
width,
1213
height,
1314
children,
15+
className,
1416
}: ScrollWrapperProps) {
15-
return <div className={cn("overflow-auto", width, height)}>{children}</div>;
17+
return (
18+
<div className={cn("overflow-auto", width, height, className)}>
19+
{children}
20+
</div>
21+
);
1622
}

0 commit comments

Comments
 (0)