Rename featured guide and featured block components

pull/1331/head
Kamran Ahmed 5 years ago
parent eee62c0f69
commit c185804341
  1. 4
      components/featured-content/guides.js
  2. 4
      components/featured-content/roadmaps.js
  3. 4
      components/featured-guide/index.js
  4. 0
      components/featured-guide/style.js
  5. 4
      components/featured-roadmap/index.js
  6. 0
      components/featured-roadmap/style.js
  7. 8
      pages/roadmaps.js

@ -1,7 +1,7 @@
import Link from 'next/link'; import Link from 'next/link';
import { FeaturedContentWrap } from './style'; import { FeaturedContentWrap } from './style';
import guides from 'data/guides'; import guides from 'data/guides';
import GuideBlock from 'components/guide-block'; import FeaturedGuide from 'components/featured-guide';
const FeaturedGuides = () => ( const FeaturedGuides = () => (
<FeaturedContentWrap className="featured-content-wrap"> <FeaturedContentWrap className="featured-content-wrap">
@ -16,7 +16,7 @@ const FeaturedGuides = () => (
{ guides { guides
.filter(({ featured }) => featured) .filter(({ featured }) => featured)
.map(guide => ( .map(guide => (
<GuideBlock guide={ guide } key={ guide.url } /> <FeaturedGuide guide={ guide } key={ guide.url } />
)) } )) }
</div> </div>
</div> </div>

@ -1,7 +1,7 @@
import Link from 'next/link'; import Link from 'next/link';
import { FeaturedContentWrap } from './style'; import { FeaturedContentWrap } from './style';
import roadmaps from 'data/roadmaps'; import roadmaps from 'data/roadmaps';
import RoadmapBlock from 'components/roadmap-block'; import FeaturedRoadmap from 'components/featured-roadmap';
const FeaturedRoadmaps = () => ( const FeaturedRoadmaps = () => (
<FeaturedContentWrap className="featured-content-wrap"> <FeaturedContentWrap className="featured-content-wrap">
@ -21,7 +21,7 @@ const FeaturedRoadmaps = () => (
{ roadmaps { roadmaps
.filter(({ featured }) => featured) .filter(({ featured }) => featured)
.map(roadmap => ( .map(roadmap => (
<RoadmapBlock roadmap={ roadmap } key={ roadmap.url } /> <FeaturedRoadmap roadmap={ roadmap } key={ roadmap.url } />
)) } )) }
</div> </div>
</div> </div>

@ -4,7 +4,7 @@ import formatDate from 'date-fns/format'
import { Author, AuthorImage, AuthorName, BlockLink, BlockMeta, BlockSubtitle, BlockTitle, PublishDate } from './style'; import { Author, AuthorImage, AuthorName, BlockLink, BlockMeta, BlockSubtitle, BlockTitle, PublishDate } from './style';
import { findByUsername } from 'lib/author'; import { findByUsername } from 'lib/author';
const GuideBlock = ({ guide }) => { const FeaturedGuide = ({ guide }) => {
const author = findByUsername(guide.author) || {}; const author = findByUsername(guide.author) || {};
return ( return (
<div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container"> <div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container">
@ -25,4 +25,4 @@ const GuideBlock = ({ guide }) => {
) )
}; };
export default GuideBlock; export default FeaturedGuide;

@ -1,7 +1,7 @@
import Link from 'next/link'; import Link from 'next/link';
import { BlockLink, BlockSubtitle, BlockTitle } from './style'; import { BlockLink, BlockSubtitle, BlockTitle } from './style';
const RoadmapBlock = ({ roadmap }) => ( const FeaturedRoadmap = ({ roadmap }) => (
<div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container"> <div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container">
<Link href={ roadmap.url } passHref> <Link href={ roadmap.url } passHref>
<BlockLink> <BlockLink>
@ -12,4 +12,4 @@ const RoadmapBlock = ({ roadmap }) => (
</div> </div>
); );
export default RoadmapBlock; export default FeaturedRoadmap;

@ -1,18 +1,10 @@
import roadmaps from 'data/roadmaps';
import DefaultLayout from 'layouts/default/index'; import DefaultLayout from 'layouts/default/index';
import SiteNav from 'components/site-nav'; import SiteNav from 'components/site-nav';
import RoadmapBlock from 'components/roadmap-block';
const RoadmapsList = () => ( const RoadmapsList = () => (
<DefaultLayout> <DefaultLayout>
<SiteNav /> <SiteNav />
<div className="container"> <div className="container">
<div className="row">
{ roadmaps
.map(roadmap => (
<RoadmapBlock roadmap={ roadmap } key={ roadmap.url } />
)) }
</div>
</div> </div>
</DefaultLayout> </DefaultLayout>
); );

Loading…
Cancel
Save