From ea9c0cf7037a31b82763c93b42160dbc50874956 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 9 Nov 2019 15:40:32 +0400 Subject: [PATCH] Add badges on roadmaps --- components/badges/index.js | 33 +++++++++++++++++++++++++++++ components/page-header/index.js | 14 +----------- components/page-header/style.js | 16 -------------- components/roadmap-summary/index.js | 16 ++++++++++++++ pages/[roadmap]/index.js | 19 ++++++++++++++--- pages/roadmaps.js | 1 + 6 files changed, 67 insertions(+), 32 deletions(-) create mode 100644 components/badges/index.js diff --git a/components/badges/index.js b/components/badges/index.js new file mode 100644 index 000000000..656e57221 --- /dev/null +++ b/components/badges/index.js @@ -0,0 +1,33 @@ +import styled from 'styled-components'; + +export const BadgesList = styled.p` + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 0; +`; + +export const PrimaryBadge = styled.span` + font-size: 11px; + font-weight: 600; + background: #2929ff; + color: white; + padding: 2px 8px; + border-radius: 4px; + text-transform: uppercase; + display: inline-flex; + align-items: center; + justify-content: center; + margin-left: 10px; + + svg { + height: 11px; + width: 11px; + margin-right: 5px; + } +`; + +export const SecondaryBadge = styled(PrimaryBadge)` + background: #696969; + color: white; +`; diff --git a/components/page-header/index.js b/components/page-header/index.js index bf12d0de0..2cfd340d5 100644 --- a/components/page-header/index.js +++ b/components/page-header/index.js @@ -1,26 +1,14 @@ -import { HeaderWrap, HeaderButtons, HeaderButton, Subtitle, Title } from './style'; +import { HeaderWrap, Subtitle, Title } from './style'; const PageHeader = ({ title, subtitle, children, - primaryButtonText, - primaryButtonUrl, - secondaryButtonText, - secondaryButtonUrl, }) => ( { title } - { - (primaryButtonText || secondaryButtonText) && - - { primaryButtonText && { primaryButtonText } } - { secondaryButtonText && { secondaryButtonText } } - - } - { children } ); diff --git a/components/page-header/style.js b/components/page-header/style.js index c50d31e28..82215fbf3 100644 --- a/components/page-header/style.js +++ b/components/page-header/style.js @@ -20,19 +20,3 @@ export const Subtitle = styled.p` font-weight: 700; } `; - -export const HeaderButton = styled.a` - box-shadow: rgba(0, 0, 0, 0.12) 0 5px 10px 0; - padding: 9px 25px; - background: ${ props => props.primary ? '#101010' : '#ffffff' } !important; - color: ${ props => props.primary ? '#ffffff' : '#101010' } !important; - border-radius: 4px; - margin-left: ${ props => !props.primary ? '15px': 0 }; - cursor: pointer; - font-size: 15px; - display: inline-block; -`; - -export const HeaderButtons = styled.div` - margin: 30px 0 0; -`; diff --git a/components/roadmap-summary/index.js b/components/roadmap-summary/index.js index 4b1deaaed..4d570601c 100644 --- a/components/roadmap-summary/index.js +++ b/components/roadmap-summary/index.js @@ -12,6 +12,10 @@ import { } from './style'; import SharePage from '../share-page'; +import { BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; + const isActiveRoadmap = (loadedVersion, roadmapVersion) => ( (loadedVersion === roadmapVersion) || (loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear()) @@ -22,6 +26,18 @@ const RoadmapSummary = ({ roadmap }) => (
{ roadmap.title } { roadmap.description } + + + { roadmap.upcoming && Upcoming Roadmap } + { roadmap.featured && Featured Roadmap } + + + + Notify Me + + + + { (roadmap.versions || []).map(versionItem => ( diff --git a/pages/[roadmap]/index.js b/pages/[roadmap]/index.js index 98c48e5d4..0a540e362 100644 --- a/pages/[roadmap]/index.js +++ b/pages/[roadmap]/index.js @@ -9,12 +9,16 @@ import Helmet from 'components/helmet'; import PageHeader from 'components/page-header'; import GuideBody from 'components/guide-body'; +import { BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; + const Roadmap = ({ roadmap }) => { if (!roadmap) { return } - if (roadmap.upcoming) { + if (false && roadmap.upcoming) { const GuideContent = require(`../../data/roadmaps/upcoming.md`).default; return ( @@ -23,8 +27,17 @@ const Roadmap = ({ roadmap }) => { + subtitle={roadmap.description}> + + Upcoming Roadmap + + + + Notify Me + + + +
diff --git a/pages/roadmaps.js b/pages/roadmaps.js index 74616e25a..667599e48 100644 --- a/pages/roadmaps.js +++ b/pages/roadmaps.js @@ -23,6 +23,7 @@ const RoadmapsList = () => (
{ roadmaps.map(roadmap => (