Skip to content

Commit 229c287

Browse files
committed
Fix Sidebar and screen scroll
1 parent 9228654 commit 229c287

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

src/app/(authenticated)/companies/CompaniesList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function CompaniesList({ companies }: CompaniesListProps) {
3030

3131
return (
3232
<>
33-
<div className="sticky top-0 pt-4 px-4">
33+
<div className="sticky top-16 pt-4 px-4 z-20">
3434
<input
3535
type="text"
3636
placeholder="Search companies"

src/app/(authenticated)/layout.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ export default async function AuthenticatedLayout({
1313
if (!session) redirect("/login");
1414

1515
return (
16-
<div className="h-screen text-white flex flex-col relative">
16+
<div className="min-h-screen text-white flex flex-col">
1717
<Toolbar />
18-
<div className="flex-1 overflow-y-scroll bg-gray-100 text-black mb-navbar">
19-
{children}
20-
</div>
18+
<div className="flex-1 bg-gray-100 text-black pb-navbar">{children}</div>
2119
<BottomNavbar />
2220
</div>
2321
);

src/app/(authenticated)/speakers/SpeakersList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function SpeakersList({ speakers }: SpeakersListProps) {
3030

3131
return (
3232
<>
33-
<div className="sticky top-0 pt-4 px-4">
33+
<div className="sticky top-16 pt-4 px-4 z-20">
3434
<input
3535
type="text"
3636
placeholder="Search speakers"

src/components/Toolbar/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Sidebar({ show, onClose }: SidebarProps) {
1414

1515
return (
1616
<div
17-
className={`z-20 fixed top-0 left-0 h-full w-full bg-sinfo-primary p-10 flex flex-col gap-6 transition-transform duration-300 ${
17+
className={`overflow-y-auto z-50 fixed inset-0 bg-sinfo-primary p-10 mb-safe flex flex-col gap-6 transition-transform duration-300 ${
1818
show ? "translate-x-0" : "-translate-x-full"
1919
}`}
2020
>

src/components/Toolbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default function Toolbar() {
2323
return (
2424
<>
2525
<Sidebar show={isExpanded} onClose={() => setIsExpanded(false)} />
26-
<div className="bg-sinfo-primary">
27-
<div className="container m-auto p-4 pb-2 flex flex-col gap-4">
26+
<div className="sticky top-0 z-10 bg-sinfo-primary">
27+
<div className="container m-auto p-4 flex flex-col gap-4">
2828
<nav className="flex flex-row items-center">
2929
<div className="w-1/6 flex justify-start items-center">
3030
{showMenu ? (

src/styles/globals.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@
1717
#scan-container .scan-region-highlight-svg {
1818
@apply !stroke-sinfo-secondary;
1919
}
20+
21+
.pb-safe {
22+
padding-bottom: env(safe-area-inset-bottom);
23+
}
24+
25+
.mb-safe {
26+
margin-bottom: env(safe-area-inset-bottom);
27+
}

0 commit comments

Comments
 (0)