Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix scroll restore #75

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/app/(category-sidebar)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function Layout({
const allCollections = await getCollections();
return (
<div className="flex flex-grow font-mono">
<aside className="hidden w-64 min-w-64 max-w-64 border-r p-4 md:block">
<aside className="sticky hidden w-64 min-w-64 max-w-64 border-r p-4 md:block">
<h2 className="border-b border-accent1 text-sm font-semibold text-accent1">
Choose a Category
</h2>
Expand All @@ -27,10 +27,7 @@ export default async function Layout({
))}
</ul>
</aside>
<main
className="h-[calc(100vh-113px)] overflow-y-auto p-4 pt-0"
id="main-content"
>
<main className="h-full overflow-y-auto p-4 pt-0" id="main-content">
{children}
</main>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export default async function RootLayout({
<body
className={`${GeistSans.variable} ${GeistMono.variable} flex flex-col antialiased`}
>
<div>
<header className="z-10 flex flex-grow items-center justify-between gap-4 border-b-2 border-accent2 bg-background p-2 pb-[4px] pt-2 sm:flex-row sm:p-4 sm:pb-[4px] sm:pt-0">
<div className="flex flex-grow flex-col">
<div className="relative">
<header className="absolute left-0 top-0 z-10 flex min-w-[100vw] flex-grow items-center justify-between gap-4 border-b-2 border-accent2 bg-background p-2 pb-[4px] pt-2 sm:flex-row sm:p-4 sm:pb-[4px] sm:pt-0">
<div className="flex min-w-full flex-grow flex-col">
<div className="absolute right-2 top-2 flex justify-end pt-2 font-sans text-sm hover:underline sm:relative sm:right-0 sm:top-0">
<Suspense
fallback={
Expand Down