Update upcoming roadmap and roadmap badges

pull/1331/head
Kamran Ahmed 5 years ago
parent 7532230ce1
commit eacb4eebd3
  1. 13
      components/badges/index.js
  2. 38
      components/roadmap-summary/index.js
  3. 3
      data/site.json

@ -31,3 +31,16 @@ export const SecondaryBadge = styled(PrimaryBadge)`
background: #696969; background: #696969;
color: white; color: white;
`; `;
export const InfoBadge = styled(PrimaryBadge)`
background: #039640;
color: white;
`;
export const BadgeLink = styled.a`
text-decoration: none;
&:hover {
text-decoration:none;
}
`;

@ -10,17 +10,20 @@ import {
VersionLink, VersionLink,
VersionList, VersionList,
} from './style'; } from './style';
import SharePage from '../share-page'; import SharePage from 'components/share-page';
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import { BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; import { faEnvelope } from '@fortawesome/free-solid-svg-icons';
import GuideBody from 'components/guide-body';
import siteConfig from "data/site";
const isActiveRoadmap = (loadedVersion, roadmapVersion) => ( const isActiveRoadmap = (loadedVersion, roadmapVersion) => (
(loadedVersion === roadmapVersion) || (loadedVersion === roadmapVersion) ||
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear()) (loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear())
); );
const UpcomingGuide = require(`../../data/roadmaps/upcoming.md`).default;
const RoadmapSummary = ({ roadmap }) => ( const RoadmapSummary = ({ roadmap }) => (
<SummaryContainer> <SummaryContainer>
<Header> <Header>
@ -29,14 +32,18 @@ const RoadmapSummary = ({ roadmap }) => (
<BadgesList className="mt-4"> <BadgesList className="mt-4">
{ roadmap.upcoming && <SecondaryBadge>Upcoming Roadmap</SecondaryBadge> } { roadmap.upcoming && <SecondaryBadge>Upcoming Roadmap</SecondaryBadge> }
{ roadmap.featured && <SecondaryBadge>Featured Roadmap</SecondaryBadge> } { !roadmap.upcoming && (
<BadgeLink href={`${siteConfig.url.issue}?title=[${roadmap.title}] - Title Here`} target="_blank">
<SecondaryBadge>Suggest Improvements</SecondaryBadge>
</BadgeLink>
) }
<a href="/signup"> <BadgeLink href="/signup">
<PrimaryBadge> <PrimaryBadge>
<FontAwesomeIcon icon={faEnvelope}/> <FontAwesomeIcon icon={faEnvelope}/>
Send me Updates Send me Updates
</PrimaryBadge> </PrimaryBadge>
</a> </BadgeLink>
</BadgesList> </BadgesList>
<VersionList className="border-bottom"> <VersionList className="border-bottom">
@ -50,10 +57,21 @@ const RoadmapSummary = ({ roadmap }) => (
</VersionList> </VersionList>
</Header> </Header>
<Summary> <Summary>
<div className="container"> {
<Image src={ roadmap.picture } /> roadmap.upcoming && (
<SharePage title={ roadmap.description } url={ roadmap.url } /> <GuideBody>
</div> <UpcomingGuide />
</GuideBody>
)
}
{
!roadmap.upcoming && (
<div className="container">
<Image src={ roadmap.picture } />
<SharePage title={ roadmap.description } url={ roadmap.url } />
</div>
)
}
</Summary> </Summary>
</SummaryContainer> </SummaryContainer>
); );

@ -11,7 +11,8 @@
"repo": "https://github.com/kamranahmedse/roadmap-next", "repo": "https://github.com/kamranahmedse/roadmap-next",
"repoData": "https://github.com/kamranahmedse/roadmap-next/tree/master/data", "repoData": "https://github.com/kamranahmedse/roadmap-next/tree/master/data",
"addGuide": "https://github.com/kamranahmedse/roadmap-next/tree/master/contributing/guide.md", "addGuide": "https://github.com/kamranahmedse/roadmap-next/tree/master/contributing/guide.md",
"addRoadmap": "https://github.com/kamranahmedse/roadmap-next/tree/master/contributing/roadmap.md" "addRoadmap": "https://github.com/kamranahmedse/roadmap-next/tree/master/contributing/roadmap.md",
"issue": "https://github.com/kamranahmedse/roadmap-next/issues/new"
}, },
"keywords": [ "keywords": [
"roadmap", "roadmap",

Loading…
Cancel
Save