Update UI for guide page

This commit is contained in:
Kamran Ahmed
2019-11-02 17:50:57 +04:00
parent cb24556d2f
commit 380b39ec2f
13 changed files with 2216 additions and 299 deletions

View File

@ -1,7 +1,7 @@
import { FaqContainer, FaqItem } from './style'; import { FaqContainer, FaqItem } from './style';
const FaqList = () => ( const FaqList = () => (
<FaqContainer className='border-top border-bottom bg-light'> <FaqContainer className='border-top bg-light'>
<FaqItem> <FaqItem>
<div className="container container-small"> <div className="container container-small">
<h4 className='font-weight-bolder'>What is roadmap.sh?</h4> <h4 className='font-weight-bolder'>What is roadmap.sh?</h4>

View File

@ -4,7 +4,7 @@ import FeaturedGuides from './guides';
import FeaturedRoadmaps from './roadmaps'; import FeaturedRoadmaps from './roadmaps';
const FeaturedContent = (props) => ( const FeaturedContent = (props) => (
<FeaturedWrap className="border-top border-bottom bg-light"> <FeaturedWrap className="border-top bg-light">
<FeaturedRoadmaps /> <FeaturedRoadmaps />
<FeaturedGuides /> <FeaturedGuides />
</FeaturedWrap> </FeaturedWrap>

View File

@ -0,0 +1,15 @@
import styled from 'styled-components';
const Link = styled.a`
font-weight: 600;
`;
const EnrichedLink = props => {
return (
<Link href={ props.href } target={ /^http(s)?:\/\//.test(props.href) ? '_blank' : '_self' }>
{ props.children }
</Link>
);
};
export default EnrichedLink;

View File

@ -1,12 +1,14 @@
import styled from 'styled-components'; import styled from 'styled-components';
export const BlockQuote = styled.blockquote` const BlockQuote = styled.blockquote`
background: transparent;
padding: 16px 20px; padding: 16px 20px;
border-left: 5px solid currentColor;
position: relative; position: relative;
background: #e8e8e8;
border-radius: 5px;
p { p {
margin: 0; margin: 0;
} }
`; `;
export default BlockQuote;

View File

@ -6,7 +6,8 @@ const linkify = (Component) => {
const text = props.children; const text = props.children;
const id = text.toLowerCase && text const id = text.toLowerCase && text
.toLowerCase() .toLowerCase()
.replace(/\s/g, '-') .replace(/[^\x00-\x7F]/g, '')
.replace(/\s+/g, '-')
.replace(/[?!]/g, ''); .replace(/[?!]/g, '');
return ( return (

View File

@ -1,16 +1,18 @@
import P from './p'; import P from './p';
import { Headings } from './heading'; import { Headings } from './heading';
import { Pre } from './pre'; import { Pre } from './pre';
import { BlockQuote } from './blockquote'; import BlockQuote from './blockquote';
import { Table } from './table'; import { Table } from './table';
import { IFrame } from './iframe'; import { IFrame } from './iframe';
import { Img } from './img'; import { Img } from './img';
import EnrichedLink from './a';
const MdxComponents = { const MdxComponents = {
p: P, p: P,
...Headings, ...Headings,
pre: Pre, pre: Pre,
blockquote: BlockQuote, blockquote: BlockQuote,
a: EnrichedLink,
table: Table, table: Table,
iframe: IFrame, iframe: IFrame,
img: Img, img: Img,

View File

@ -4,11 +4,10 @@ const P = styled.p`
color: inherit; color: inherit;
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 1.6; line-height: 27px;
margin: 16px 0; margin: 16px 0;
img + em { img + em {
display: block;
text-align: center; text-align: center;
color: #666666; color: #666666;
font-style: normal; font-style: normal;

View File

@ -2,7 +2,7 @@ import Link from 'next/link';
import { FooterWrap } from './style.js' import { FooterWrap } from './style.js'
const PageFooter = () => ( const PageFooter = () => (
<FooterWrap> <FooterWrap className="border-top">
<div className="container"> <div className="container">
<div className="foot-cols-wrap row"> <div className="foot-cols-wrap row">
<div className="site-meta-wrap col-12 col-sm-12 col-lg col-xl col-md-12"> <div className="site-meta-wrap col-12 col-sm-12 col-lg col-xl col-md-12">

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,10 @@
max-width: 800px; max-width: 800px;
} }
ul li, ol li {
margin-bottom: 7px;
}
.border-top { .border-top {
border-top: 1px solid #eaeaea; border-top: 1px solid #eaeaea;
} }

View File

@ -18,7 +18,9 @@ const Guide = ({ guide }) => {
Guide.getInitialProps = serverOnlyProps(({ req }) => { Guide.getInitialProps = serverOnlyProps(({ req }) => {
// Remove URL chunk to make it a slug e.g. /guides/some-guide-item to become `some-guide-item // Remove URL chunk to make it a slug e.g. /guides/some-guide-item to become `some-guide-item
const slug = req.url.replace(/^\/*?guides\/*?/, '/').replace(/\/*$/, ''); const slug = req.url
.replace(/^\/*?guides\/*?/, '/')
.replace(/\/*$/, '');
return { return {
slug, slug,

View File

@ -7,7 +7,7 @@ const Privacy = () => (
<DefaultLayout> <DefaultLayout>
<TosPage> <TosPage>
<PageHeader /> <PageHeader />
<div className="bg-light border-top border-bottom privacy-wrap"> <div className="bg-light border-top privacy-wrap">
<div className="container pt-5 pb-5"> <div className="container pt-5 pb-5">
<h2 className='font-weight-bold mb-3'>Privacy Policy</h2> <h2 className='font-weight-bold mb-3'>Privacy Policy</h2>
<p>By using or accessing the Services in any manner, you acknowledge that you accept the practices and policies outlined in this Privacy Policy, and you hereby consent that we will collect, use, and share your information in the following ways. Remember that your use of roadmap.shs Services is at all times subject to the <a <p>By using or accessing the Services in any manner, you acknowledge that you accept the practices and policies outlined in this Privacy Policy, and you hereby consent that we will collect, use, and share your information in the following ways. Remember that your use of roadmap.shs Services is at all times subject to the <a

View File

@ -7,7 +7,7 @@ const Terms = () => (
<DefaultLayout> <DefaultLayout>
<TosPage> <TosPage>
<PageHeader /> <PageHeader />
<div className="bg-light border-top border-bottom tos-wrap"> <div className="bg-light border-top tos-wrap">
<div className="container pt-5 pb-5"> <div className="container pt-5 pb-5">
<h2>Terms of Service</h2> <h2>Terms of Service</h2>