Skip to content

Commit c238318

Browse files
committed
fix: adjust sidebar height and scrolling behavior
1 parent 21fc72a commit c238318

File tree

4 files changed

+220
-204
lines changed

4 files changed

+220
-204
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,14 @@ series: 나의 맞춤 블로그 만들기
545545

546546
- [ ] contents layer 로 대체
547547
- [ ] 소개 패이지
548-
- [ ] 포트폴리오 페이지
548+
- [x] 포트폴리오 페이지
549549
- [ ] 댓글 기능
550550
- [ ] 옵시디언 스타일의 콜아웃 적용
551551
- [ ] 비디오 임베드
552+
- [ ] D3.js를 홀용한 그래프 뷰
553+
- [ ] 연결된 관련 노트 리스트 추가
554+
555+
## 고칠것
556+
557+
- 사이드바 스크롤
558+
카테고리의 길이가 너무 늘어나면 전체 페이지 하단에 도달할때까지 스크롤이 안됨 카테고리의 최대 높이를 정하고 스크롤로 표현해야함

app/(blog)/layout.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ import LeftSidebar from "@/components/left-sidebar";
22
import RightSidebar from "@/components/right-sidebar";
33

44
export default function BlogLayout({
5-
children,
5+
children,
66
}: {
7-
children: React.ReactNode;
7+
children: React.ReactNode;
88
}) {
9-
return (
10-
<>
11-
<LeftSidebar className="w-60 xl:w-64 2xl:w-72 lg:shrink-0 lg:sticky h-full lg:top-16 mb-4 lg:mb-0 mt-52" />
12-
<div className="xl:max-w-5xl mx-auto rounded-lg w-full overflow-x-hidden py-6 p-3 2xl:px-6 h-full overflow-y-hidden">
13-
{children}
14-
</div>
15-
<RightSidebar className="w-60 xl:w-64 2xl:w-72 shrink-0 hidden xl:block sticky top-16 h-full mt-52" />
16-
</>
17-
);
9+
return (
10+
<>
11+
<LeftSidebar className="w-60 xl:w-64 2xl:w-72 lg:shrink-0" />
12+
{/* 높이 관련 클래스 제거 */}
13+
<div className="xl:max-w-5xl mx-auto rounded-lg w-full overflow-x-hidden py-6 p-3 2xl:px-6">
14+
{children}
15+
</div>
16+
<RightSidebar className="w-60 xl:w-64 2xl:w-72 lg:shrink-0" />
17+
</>
18+
);
1819
}

components/left-sidebar.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export default function LeftSidebar({ className }: LeftSidebarProps) {
2828
{/* 데스크톱 버전 */}
2929
<motion.aside
3030
key={sidebarKey}
31-
className={cn("hidden xl:block", className)}
31+
className={cn(
32+
"hidden xl:block h-[calc(100vh-4rem)] sticky top-16 mt-52", // 높이와 sticky 설정 수정
33+
className,
34+
)}
3235
initial={{ opacity: 0, x: -20 }}
3336
animate={{ opacity: 1, x: 0 }}
3437
transition={{
@@ -37,7 +40,10 @@ export default function LeftSidebar({ className }: LeftSidebarProps) {
3740
delay: 0.05,
3841
}}
3942
>
40-
<ScrollArea className="h-full">
43+
{/* ScrollArea에 명확한 높이 지정 */}
44+
<ScrollArea className="h-full pb-8">
45+
{" "}
46+
{/* 하단에 약간의 패딩 추가 */}
4147
{/* 네비게이션 메뉴 (데스크톱) */}
4248
<SidebarSection title="메뉴">
4349
<motion.div
@@ -99,7 +105,6 @@ export default function LeftSidebar({ className }: LeftSidebarProps) {
99105
</div>
100106
</motion.div>
101107
</SidebarSection>
102-
103108
<SidebarSection title="카테고리">
104109
<motion.div
105110
initial={{ opacity: 0 }}

0 commit comments

Comments
 (0)