-
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
- Loading branch information
Showing
20 changed files
with
696 additions
and
539 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 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
29 changes: 29 additions & 0 deletions
29
frontend/workflows/projectCatalog/src/details/components/header.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,29 @@ | ||
import React from "react"; | ||
import { Grid, styled, Typography } from "@clutch-sh/core"; | ||
|
||
export interface ProjectHeaderProps { | ||
title?: string; | ||
description?: string; | ||
} | ||
|
||
const StyledContainer = styled(Grid)({ | ||
width: "100%", | ||
height: "100%", | ||
}); | ||
|
||
const ProjectHeader = ({ title, description = "" }: ProjectHeaderProps) => ( | ||
<StyledContainer container direction="column"> | ||
<Grid item> | ||
<Typography variant="h2" textTransform="capitalize"> | ||
{title} | ||
</Typography> | ||
</Grid> | ||
{description.length > 0 && ( | ||
<Grid item> | ||
<Typography variant="body2">{description}</Typography> | ||
</Grid> | ||
)} | ||
</StyledContainer> | ||
); | ||
|
||
export default ProjectHeader; |
Oops, something went wrong.