Update roadmap

pull/936/head
Kamran Ahmed 3 years ago
parent 3b47cd3542
commit 9d9a6506cc
  1. 26
      pages/[roadmap]/[group].tsx

@ -20,6 +20,7 @@ type RoadmapProps = {
group: string; group: string;
}; };
// @todo error handling
function TextualRoadmap(props: RoadmapProps) { function TextualRoadmap(props: RoadmapProps) {
const { roadmap, group } = props; const { roadmap, group } = props;
if (!roadmap.contentPathsFilePath) { if (!roadmap.contentPathsFilePath) {
@ -33,7 +34,9 @@ function TextualRoadmap(props: RoadmapProps) {
const contentFilePath = contentPathMapping[group] || ''; const contentFilePath = contentPathMapping[group] || '';
const normalizedContentFilePath = contentFilePath.replace(/^\//, ''); const normalizedContentFilePath = contentFilePath.replace(/^\//, '');
const GroupContent = require(`../../content/${normalizedContentFilePath}`).default; const GroupContent =
require(`../../content/${normalizedContentFilePath}`).default;
const groupParts = group.split(':');
return ( return (
<Container maxW={'container.md'} position="relative"> <Container maxW={'container.md'} position="relative">
@ -44,25 +47,18 @@ function TextualRoadmap(props: RoadmapProps) {
separator={<ChevronRightIcon color="gray.500" />} separator={<ChevronRightIcon color="gray.500" />}
> >
<BreadcrumbItem> <BreadcrumbItem>
<BreadcrumbLink color="blue.500" href="/frontend"> <BreadcrumbLink color="blue.500" href={`/${roadmap.id}`}>
Frontend {roadmap.featuredTitle}
</BreadcrumbLink> </BreadcrumbLink>
</BreadcrumbItem> </BreadcrumbItem>
<BreadcrumbItem> {groupParts.map((groupPart: string, counter: number) => (
<BreadcrumbLink color="blue.500" href="/frontend/internet"> <BreadcrumbItem key={groupPart}>
Internet <BreadcrumbLink color="blue.500" href={`/${roadmap.id}/${groupPart}`}>
</BreadcrumbLink> {groupPart.split('-').join(' ')}
</BreadcrumbItem>
<BreadcrumbItem isCurrentPage>
<BreadcrumbLink
color="blue.500"
href="/frontend/internet:what-is-internet"
>
What is Internet
</BreadcrumbLink> </BreadcrumbLink>
</BreadcrumbItem> </BreadcrumbItem>
))}
</Breadcrumb> </Breadcrumb>
</Box> </Box>
<MdRenderer> <MdRenderer>

Loading…
Cancel
Save