-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
total layout design for an admin panel
- Loading branch information
nishan.aitc
committed
Oct 2, 2023
1 parent
00b024f
commit db2a7a8
Showing
8 changed files
with
111 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { BiChevronRight } from "react-icons/bi"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
|
||
const Breadcrumb = () => { | ||
const location = useLocation(); | ||
const pathSegments = location.pathname | ||
.split("/") | ||
.filter((segment) => segment !== ""); | ||
const noindexpage = ["Home"]; | ||
return ( | ||
<div className="breadcrumb hidden md:flex gap-1 items-center font-bold"> | ||
{pathSegments.map((segment, index) => ( | ||
<React.Fragment key={segment}> | ||
{index > 0 && <BiChevronRight size={20} />} | ||
{index === pathSegments.length - 1 ? ( | ||
<span className="capitalize "> | ||
{segment === "dashboard" ? "Overview" : segment} | ||
</span> | ||
) : noindexpage?.includes(segment) ? ( | ||
<span className="capitalize text-[#595959] pointer-events-none"> | ||
{segment} | ||
</span> | ||
) : ( | ||
<Link | ||
to={`/${pathSegments.slice(0, index + 1).join("/")}`} | ||
className="capitalize text-[#595959]" | ||
> | ||
{segment} | ||
</Link> | ||
)} | ||
</React.Fragment> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Breadcrumb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters