|
|
@ -12,6 +12,11 @@ import { |
|
|
|
VersionList, |
|
|
|
VersionList, |
|
|
|
} from './style'; |
|
|
|
} from './style'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isActiveRoadmap = (loadedVersion, roadmapVersion) => ( |
|
|
|
|
|
|
|
(loadedVersion === roadmapVersion) || |
|
|
|
|
|
|
|
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const RoadmapSummary = ({ roadmap }) => ( |
|
|
|
const RoadmapSummary = ({ roadmap }) => ( |
|
|
|
<SummaryContainer> |
|
|
|
<SummaryContainer> |
|
|
|
<Header> |
|
|
|
<Header> |
|
|
@ -21,7 +26,7 @@ const RoadmapSummary = ({ roadmap }) => ( |
|
|
|
{ (roadmap.versions || []).map(versionItem => ( |
|
|
|
{ (roadmap.versions || []).map(versionItem => ( |
|
|
|
<Link href={ `${roadmap.slug}/${versionItem}` } passHref key={ versionItem }> |
|
|
|
<Link href={ `${roadmap.slug}/${versionItem}` } passHref key={ versionItem }> |
|
|
|
<VersionLink className={ classNames({ |
|
|
|
<VersionLink className={ classNames({ |
|
|
|
active: versionItem === roadmap.version, |
|
|
|
active: isActiveRoadmap(versionItem, roadmap.version), |
|
|
|
}) }>{ versionItem } Version</VersionLink> |
|
|
|
}) }>{ versionItem } Version</VersionLink> |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
)) } |
|
|
|
)) } |
|
|
|