From 618b55f601b6027527e2834fe0ac33b7deb170f4 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 30 Nov 2019 09:06:06 +0400 Subject: [PATCH] Split roadmap header to separate component --- components/roadmap-body/index.js | 33 +++++++++++++ components/roadmap-body/style.js | 13 ++++++ components/roadmap-header/index.js | 43 +++++++++++++++++ components/roadmap-header/style.js | 17 +++++++ components/roadmap-summary/index.js | 72 ----------------------------- components/roadmap-summary/style.js | 67 --------------------------- components/share-page/index.js | 2 +- components/share-page/style.js | 3 +- pages/[roadmap]/index.js | 6 ++- 9 files changed, 112 insertions(+), 144 deletions(-) create mode 100644 components/roadmap-body/index.js create mode 100644 components/roadmap-body/style.js create mode 100644 components/roadmap-header/index.js create mode 100644 components/roadmap-header/style.js delete mode 100644 components/roadmap-summary/index.js delete mode 100644 components/roadmap-summary/style.js diff --git a/components/roadmap-body/index.js b/components/roadmap-body/index.js new file mode 100644 index 000000000..25be6723c --- /dev/null +++ b/components/roadmap-body/index.js @@ -0,0 +1,33 @@ +import { Summary, SummaryContainer } from './style'; +import SharePage from 'components/share-page'; +import MdRenderer from 'components/md-renderer'; + +const UpcomingGuide = require(`../../storage/guides/upcoming.md`).default; + +const RoadmapBody = ({ roadmap }) => { + return ( + + + { + roadmap.upcoming && ( +
+ + + +
+ ) + } + { + !roadmap.upcoming && ( +
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut beatae blanditiis commodi, consequatur, dicta distinctio esse et id, ipsa labore libero nisi odit placeat possimus saepe sed vel vitae voluptate?

+ +
+ ) + } +
+
+ ) +}; + +export default RoadmapBody; diff --git a/components/roadmap-body/style.js b/components/roadmap-body/style.js new file mode 100644 index 000000000..557a46888 --- /dev/null +++ b/components/roadmap-body/style.js @@ -0,0 +1,13 @@ +import styled from 'styled-components'; + +export const SummaryContainer = styled.div``; + +export const Summary = styled.div` + text-align: center; + padding: 40px 0 50px; + min-height: 400px; + + .container { + position: relative; + } +`; diff --git a/components/roadmap-header/index.js b/components/roadmap-header/index.js new file mode 100644 index 000000000..36328c147 --- /dev/null +++ b/components/roadmap-header/index.js @@ -0,0 +1,43 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faArrowLeft, faClock, faEnvelope, faHandshake } from '@fortawesome/free-solid-svg-icons'; +import { BadgeLink, BadgesList, DarkBadge, PrimaryBadge, SecondaryBadge } from 'components/badges'; +import siteConfig from "storage/site"; +import { Description, Header, Title, VersionList } from './style'; + +const RoadmapHeader = ({ roadmap }) => ( +
+ { roadmap.title } + { roadmap.description } + + + + + Other Roadmaps + + + { roadmap.upcoming && ( + + + Upcoming Roadmap + + ) } + { !roadmap.upcoming && ( + + + + Suggest Changes + + + ) } + + + + + Send me Updates + + + +
+); + +export default RoadmapHeader; diff --git a/components/roadmap-header/style.js b/components/roadmap-header/style.js new file mode 100644 index 000000000..4024f61c9 --- /dev/null +++ b/components/roadmap-header/style.js @@ -0,0 +1,17 @@ +import styled from 'styled-components'; + +export const Header = styled.div` + text-align: center; + padding: 45px 30px 30px; +`; + +export const Title = styled.h1` + font-weight: 700; + margin-bottom: 12px; + font-size: 48px; +`; + +export const Description = styled.p` + font-size: 16px; + color: #444444; +`; diff --git a/components/roadmap-summary/index.js b/components/roadmap-summary/index.js deleted file mode 100644 index c7228e61b..000000000 --- a/components/roadmap-summary/index.js +++ /dev/null @@ -1,72 +0,0 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faArrowLeft, faClock, faEnvelope, faHandshake } from '@fortawesome/free-solid-svg-icons'; -import { Description, Header, Summary, SummaryContainer, Title, VersionList } from './style'; -import SharePage from 'components/share-page'; -import { BadgeLink, BadgesList, DarkBadge, PrimaryBadge, SecondaryBadge } from 'components/badges'; -import siteConfig from "storage/site"; -import MdRenderer from '../md-renderer'; - -const UpcomingGuide = require(`../../storage/guides/upcoming.md`).default; - -const RoadmapSummary = ({ roadmap }) => { - return ( - -
- { roadmap.title } - { roadmap.description } - - - - - Other Roadmaps - - - { roadmap.upcoming && ( - - - Upcoming Roadmap - - ) } - { !roadmap.upcoming && ( - - - - Suggest Changes - - - ) } - - - - - Send me Updates - - - - - -
- - { - roadmap.upcoming && ( -
- - - -
- ) - } - { - !roadmap.upcoming && ( -
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut beatae blanditiis commodi, consequatur, dicta distinctio esse et id, ipsa labore libero nisi odit placeat possimus saepe sed vel vitae voluptate?

- -
- ) - } -
-
- ) -}; - -export default RoadmapSummary; diff --git a/components/roadmap-summary/style.js b/components/roadmap-summary/style.js deleted file mode 100644 index 1270b710a..000000000 --- a/components/roadmap-summary/style.js +++ /dev/null @@ -1,67 +0,0 @@ -import styled from 'styled-components'; - -export const SummaryContainer = styled.div``; - -export const Header = styled.div` - text-align: center; - padding: 45px 30px 55px; -`; - -export const Summary = styled.div` - text-align: center; - padding: 0 0 50px; - - .container { - position: relative; - } -`; - -export const Title = styled.h1` - font-weight: 700; - margin-bottom: 12px; - font-size: 48px; -`; - -export const Description = styled.p` - font-size: 16px; - color: #444444; -`; - -export const Image = styled.img` - width: 100%; -`; - -export const VersionList = styled.div` - margin: 35px 0 15px; -`; - -export const VersionLink = styled.a` - display: inline-block; - position: relative; - padding: 5px 10px 8px; - text-decoration: none; - color: rgb(102, 102, 102); - font-size: 14px; - font-weight: 400; - text-transform: capitalize; - - &.active, &.active:hover { - color: #2d2d2d; - - &:after { - position: absolute; - content: ""; - display: block; - height: 0; - left: 9px; - right: 9px; - bottom: -1px; - border-bottom: 2px solid currentColor; - } - } - - &:hover { - text-decoration: none; - color: #111111; - } -`; diff --git a/components/share-page/index.js b/components/share-page/index.js index adf616299..e4ac3ce03 100644 --- a/components/share-page/index.js +++ b/components/share-page/index.js @@ -10,7 +10,7 @@ const SharePage = ({ twitterUsername, }) => ( - + { if (!roadmap) { @@ -16,7 +17,8 @@ const Roadmap = ({ roadmap }) => { - + + );