diff --git a/pages/blog/[slug].js b/pages/blog/[slug].js new file mode 100644 index 0000000..2f14636 --- /dev/null +++ b/pages/blog/[slug].js @@ -0,0 +1,31 @@ +import Image from 'next/image'; + +import AppLayout from '../../core/layout/AppLayout'; + +const BlogArticle = () => ( + +
+
+ Alt Text +
+ Posted On: 8 August, 2022 +
+

Blog Title

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit quod voluptatibus sunt + dolore, distinctio necessitatibus aperiam saepe nemo recusandae mollitia! +

+
+
+
+
+); + +export default BlogArticle; diff --git a/pages/blog/components/BlogCardsContainer.js b/pages/blog/components/BlogCardsContainer.js new file mode 100644 index 0000000..1316282 --- /dev/null +++ b/pages/blog/components/BlogCardsContainer.js @@ -0,0 +1,64 @@ +import Image from 'next/image'; +import Link from 'next/link'; + +import Button from '../../../core/components/elements/button/index'; + +const BlogCardsContainer = ({ dummyPostsData }) => ( +
+
+

Recent Posts

+
+ {dummyPostsData && + dummyPostsData.map((post) => ( +
+ + + {post.title} + + +
+
+ {post.date} + {post && + post.tags.map((tag) => ( + + + + {tag} + + + + ))} +
+
+ + + {post.title} + + +
+

{post.description}

+
+ + + + + +
+
+ ))} +
+
+
+); + +export default BlogCardsContainer; diff --git a/pages/blog/components/BlogHeader.js b/pages/blog/components/BlogHeader.js new file mode 100644 index 0000000..8d9de3a --- /dev/null +++ b/pages/blog/components/BlogHeader.js @@ -0,0 +1,15 @@ +import React from 'react'; + +const BlogHeader = () => ( +
+
+

Blog

+
+

+ "Read various topics from various bloggers and contributors." +

+
+
+); + +export default BlogHeader; diff --git a/pages/blog/index.js b/pages/blog/index.js index 5892e44..9aea78e 100644 --- a/pages/blog/index.js +++ b/pages/blog/index.js @@ -1,8 +1,48 @@ import AppLayout from '../../core/layout/AppLayout'; +import BlogCardsContainer from './components/BlogCardsContainer'; +import BlogHeader from './components/BlogHeader'; + +// Dummy data to represent how data will be represented after API call +const dummyPostsData = [ + { + id: 1, + title: 'Tech Malawi: The Future is now', + slug: 'tech-malawi-the-future-is-now', + postImage: '/blog-hero-open-book.jpg', + description: + 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum doloremque dolore officiisrecusandae ab nam eos explicabo.', + body: '', + date: '7 August, 2022', + tags: ['Tech', 'Malawi'], + }, + { + id: 2, + title: 'Tech Malawi Community Launches Website', + slug: 'tech-malawi-community-launches-website', + postImage: '/blog-hero-open-book.jpg', + description: + 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Ab nam eos explicabo ab nam eos explicabo ab nam eos explicaboab nam eos explicabo', + body: '', + date: '6 August, 2022', + tags: ['Tech', 'Next.js'], + }, + { + id: 3, + title: 'The Buga of Malawian Tech', + slug: 'the-buga-of-malawian-tech', + postImage: '/blog-hero-open-book.jpg', + description: + 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum doloremque dolore officiisrecusandae ab nam eos explicabo.', + body: '', + date: '4 August, 2022', + tags: ['Tech', 'Innovation'], + }, +]; const Blog = () => ( -

Blog

+ +
); diff --git a/public/blog-hero-open-book.jpg b/public/blog-hero-open-book.jpg new file mode 100644 index 0000000..ab87096 Binary files /dev/null and b/public/blog-hero-open-book.jpg differ diff --git a/tailwind.config.js b/tailwind.config.js index c15e769..692170d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -14,6 +14,10 @@ module.exports = { 'malawi-red': '#DA0037', 'malawi-white': '#FFFFFF', }, + + backgroundImage: { + 'blog-hero': "url('/blog-hero-open-book.jpg')", + }, }, }, plugins: [],