Skip to content

Commit 5923279

Browse files
committed
fix: 루트 overflow 수정
1 parent ccf6a87 commit 5923279

4 files changed

Lines changed: 16 additions & 19 deletions

File tree

app/layout.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import "./globals.css";
22

3-
import { AnimatePresence } from "motion/react";
43
import type { Metadata } from "next";
54
import { Geist, Geist_Mono } from "next/font/google";
65

@@ -61,21 +60,19 @@ export default async function RootLayout({
6160
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
6261
>
6362
<ThemeProvider initialTheme="light">
64-
<AnimatePresence>
65-
<div className="flex h-screen overflow-y-hidden">
66-
<div className="fixed top-0 left-0 z-50 hidden h-screen w-80 p-4 md:block">
67-
<Sidebar categories={categories} />
68-
</div>
69-
<div
70-
id="content-wrapper"
71-
className="flex-1 overflow-x-hidden overflow-y-scroll px-4 pb-24 md:pb-0 md:pl-84 lg:pr-0"
72-
>
73-
<ScrollRestoration />
74-
{children}
75-
</div>
76-
<MobileBottomTab />
63+
<div className="flex overflow-y-hidden">
64+
<div className="fixed top-0 left-0 z-50 hidden h-screen w-80 p-4 md:block">
65+
<Sidebar categories={categories} />
7766
</div>
78-
</AnimatePresence>
67+
<div
68+
id="content-wrapper"
69+
className="flex-1 overflow-x-hidden px-4 pb-24 md:pb-0 md:pl-84 lg:pr-0"
70+
>
71+
<ScrollRestoration />
72+
{children}
73+
</div>
74+
<MobileBottomTab />
75+
</div>
7976
</ThemeProvider>
8077
</body>
8178
</html>

app/search/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from "next";
22

33
import { SITE_NAME } from "@/constants/site-metadata";
4+
45
import { SearchPageClient } from "../../src/components/search/search-page-client";
56

67
export const metadata: Metadata = {

src/components/post/post-detail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const PostDetail = ({
127127
</motion.div>
128128

129129
<motion.div
130-
className="relative z-50 hidden w-[280px] shrink-0 border-l bg-white/90 p-6 backdrop-blur-md min-[1600px]:block dark:border-neutral-700 dark:bg-neutral-900/90"
130+
className="fixed top-0 right-0 z-50 hidden h-screen w-[280px] overflow-hidden border-l bg-white/90 p-6 backdrop-blur-md min-[1600px]:block dark:border-neutral-700 dark:bg-neutral-900/90"
131131
initial={{ opacity: 0, x: 40 }}
132132
animate={{ opacity: 1, x: 0 }}
133133
>

src/components/post/sticky-post-header.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@ export function StickyPostHeader({ title, onBack }: StickyPostHeaderProps) {
2626

2727
useEffect(() => {
2828
const sentinel = sentinelRef.current;
29-
if (!sentinel) return;
3029

31-
const root = document.getElementById("content-wrapper");
30+
if (!sentinel) return;
3231

3332
const observer = new IntersectionObserver(
3433
([entry]) => {
3534
const isVisible = !entry.isIntersecting;
3635
setVisible(isVisible);
3736
if (isVisible) updateRect();
3837
},
39-
{ root, threshold: 0 },
38+
{ root: null, threshold: 0 },
4039
);
4140

4241
observer.observe(sentinel);

0 commit comments

Comments
 (0)