computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
import Link from 'next/link'; |
|
import classNames from 'classnames'; |
|
import { |
|
SummaryContainer, |
|
Title, |
|
Description, |
|
Image, |
|
Header, |
|
Summary, |
|
VersionLink, |
|
VersionList, |
|
} from './style'; |
|
import SharePage from '../share-page'; |
|
|
|
const isActiveRoadmap = (loadedVersion, roadmapVersion) => ( |
|
(loadedVersion === roadmapVersion) || |
|
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear()) |
|
); |
|
|
|
const RoadmapSummary = ({ roadmap }) => ( |
|
<SummaryContainer> |
|
<Header> |
|
<Title>{ roadmap.title }</Title> |
|
<Description>{ roadmap.description }</Description> |
|
<VersionList className="border-bottom"> |
|
{ (roadmap.versions || []).map(versionItem => ( |
|
<Link href={ `${roadmap.url}/${versionItem}` } passHref key={ versionItem }> |
|
<VersionLink className={ classNames({ |
|
active: isActiveRoadmap(versionItem, roadmap.version), |
|
}) }>{ versionItem } Version</VersionLink> |
|
</Link> |
|
)) } |
|
</VersionList> |
|
</Header> |
|
<Summary> |
|
<div className="container"> |
|
<Image src={ roadmap.picture } /> |
|
<SharePage title={ roadmap.description } url={ roadmap.url } /> |
|
</div> |
|
</Summary> |
|
</SummaryContainer> |
|
); |
|
|
|
export default RoadmapSummary;
|
|
|