-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Project Catalog - Rework of layout (#3128)
- Loading branch information
Showing
26 changed files
with
726 additions
and
548 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as getDisplayName } from "./getDisplayName"; | ||
export { default as findPathMatchList } from "./pathMatching"; |
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 was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
frontend/workflows/projectCatalog/src/details/components/breadcrumbs.tsx
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,46 @@ | ||
import React from "react"; | ||
import { Typography, useTheme } from "@clutch-sh/core"; | ||
import { alpha, Breadcrumbs, Link } from "@mui/material"; | ||
|
||
interface Route { | ||
title: string; | ||
path?: string; | ||
} | ||
|
||
export interface BreadCrumbsProps { | ||
routes?: Route[]; | ||
} | ||
|
||
const BreadCrumbs = ({ routes = [] }: BreadCrumbsProps) => { | ||
const theme = useTheme(); | ||
routes.unshift({ title: "Project Catalog", path: "/catalog" }); | ||
|
||
let builtRoute = routes[0].path; | ||
|
||
const buildCrumb = (route: Route) => { | ||
if (route?.path && route?.path !== builtRoute) { | ||
builtRoute += `/${route.path}`; | ||
} | ||
|
||
return ( | ||
<Typography | ||
textTransform="uppercase" | ||
variant="caption2" | ||
color={alpha(theme.palette.secondary[900], 0.48)} | ||
key={route.title} | ||
> | ||
{route.path ? ( | ||
<Link color="inherit" href={builtRoute} underline="hover"> | ||
{route.title} | ||
</Link> | ||
) : ( | ||
route.title | ||
)} | ||
</Typography> | ||
); | ||
}; | ||
|
||
return <Breadcrumbs aria-label="breadcrumbs">{routes.map(buildCrumb)}</Breadcrumbs>; | ||
}; | ||
|
||
export default BreadCrumbs; |
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
Oops, something went wrong.