Skip to content

Commit a90184d

Browse files
committed
Make header and breadcrumbs sticky
1 parent 2cd6431 commit a90184d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/[locale]/(user)/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

3-
import { notFound, usePathname } from 'next/navigation';
43
import React from 'react';
4+
import { notFound, usePathname } from 'next/navigation';
55

66
import MainFooter from '../dashboard/components/main-footer';
77
import { MainNav } from '../dashboard/components/main-nav';
@@ -21,7 +21,7 @@ export default function Layout({ children }: UserLayoutProps) {
2121

2222
return (
2323
<div className="flex h-full grow flex-col">
24-
<header className="relative z-2 bg-primaryBlue ">
24+
<header className="z-1 sticky top-0 bg-primaryBlue">
2525
<MainNav hideSearch={hideSearch} />
2626
</header>
2727
<>{children}</>

app/[locale]/dashboard/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface DashboardLayoutProps {
1212
export default function Layout({ children }: DashboardLayoutProps) {
1313
return (
1414
<div className="flex h-full grow flex-col">
15-
<header className="relative z-2 bg-primaryBlue ">
15+
<header className="sticky top-0 z-1 bg-primaryBlue">
1616
<MainNav />
1717
</header>
1818
<>{children}</>

components/BreadCrumbs/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ interface BreadCrumbsProps {
1414

1515
const BreadCrumbs: React.FC<BreadCrumbsProps> = ({ data }) => {
1616
return (
17-
<div className=" bg-secondaryOrange px-6 py-2 lg:px-10">
17+
<div className="sticky top-[70px] lg:top-[85px] z-1 bg-secondaryOrange px-6 py-2 lg:px-10 border-b">
1818
<Breadcrumb className="mx-1">
1919
<BreadcrumbList className=''>
2020
{data.map((item, index) => (
2121
<React.Fragment key={index}>
2222
{index === data.length - 1 ? (
2323
<BreadcrumbItem>
24-
<BreadcrumbPage className='font-bold'>{item.label}</BreadcrumbPage>
24+
<BreadcrumbPage className='font-bold' >{item.label}</BreadcrumbPage>
2525
</BreadcrumbItem>
2626
) : (
2727
<BreadcrumbItem>

0 commit comments

Comments
 (0)