Skip to content

Commit ff961b6

Browse files
committed
feat: update default scrollbar style
1 parent dca089d commit ff961b6

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/layouts/main.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { Link } from '@tanstack/react-router'
55
import { Header } from './header'
66

77
import { SidebarMenu } from '../components/menu/sidebar'
8+
import { ScrollArea } from '../components/ui/scroll-area'
89

910
import logoLaucher from '../_assets/aerial-launcher.png'
1011

1112
import { whatIsThis } from '../lib/callbacks'
13+
import { cn } from '../lib/utils'
1214

1315
export function MainLayout({ children }: PropsWithChildren) {
1416
return (
@@ -34,8 +36,14 @@ export function MainLayout({ children }: PropsWithChildren) {
3436
</div>
3537
<div className="flex flex-col">
3638
<Header />
37-
<main className="flex flex-col gap-4 h-[calc(100vh-var(--header-height))] overflow-y-auto p-4 relative lg:gap-6 lg:p-6">
38-
{children}
39+
<main className="">
40+
<ScrollArea
41+
viewportClassName={cn(
42+
'main-wrapper-content [&>div]:!flex [&>div]:flex-col [&>div]:gap-4 [&>div]:h-[calc(100vh-var(--header-height))] [&>div]:p-4 [&>div]:relative [&>div]:lg:gap-6 [&>div]:lg:p-6'
43+
)}
44+
>
45+
{children}
46+
</ScrollArea>
3947
</main>
4048
</div>
4149
</div>

src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function useScrollToTop() {
2929

3030
useEffect(() => {
3131
if (!$main.current) {
32-
$main.current = document.querySelector('main')
32+
$main.current = document.querySelector('.main-wrapper-content')
3333
}
3434

3535
$main.current?.scroll({

0 commit comments

Comments
 (0)