Skip to content

Commit

Permalink
feat: blog page #99 (#105)
Browse files Browse the repository at this point in the history
* added a blog page

* fixed #99

* update gitignore and package-lock.json
  • Loading branch information
aritroCoder authored Oct 2, 2022
1 parent 96f918d commit be4e514
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 8 deletions.
52 changes: 52 additions & 0 deletions src/components/Resources/Blogs/Blog.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.blogs__container{
display: flex;
flex-direction: column;
justify-content: left;
text-align: left;
height: 100%;
width: 400px;
border-radius: 10px;
background-color: #0d1117;
margin: 20px 1%;
padding: 15px 20px;
}
.blogs__container__title{
margin: 10px 0;
padding: 10px 0;
}
.blogs__container__title h1{
font-size: 1.8rem;
font-weight: 600;
}
.blogs__container__title h6{
font-size: 0.9rem;
font-weight: 400;
}
.tags{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text-align: center;
margin: 10px 0;
padding: 10px 0;
}
.tag{
margin: 0 5px;
padding: 10 15px;
border-radius: 5px;
background-color: #1f6feb;
color: #fff;
font-size: 0.8rem;
font-weight: 400;
}
.AllBlogs{
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.blogImg{
margin-bottom: 9px;
}
33 changes: 25 additions & 8 deletions src/components/Resources/Blogs/Blogs.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import React from 'react';
import {Section} from "../WriteUps/WriteUpsElements";
import React from "react";
import { Section } from "../WriteUps/WriteUpsElements";
import BlogsElements from "./BlogsElements";
import "./Blog.css";

// probably recieved by a api call
const blogs = {
title: "Lorem, ipsum",
author: "Dean A.",
date: "1st October 2022",
content: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex molestias nam, iure hic, sunt totam, eaque corporis inventore mollitia nemo saepe eligendi cumque numquam dolor placeat architecto pariatur fugiat accusantium!\nLorem ipsum dolor sit, amet consectetur adipisicing elit. Earum, cum perspiciatis pariatur facere soluta consectetur rerum aut ex quas deserunt inventore, dignissimos dicta blanditiis? Adipisci incidunt odio eaque nobis earum sit! Sequi, ducimus debitis. Commodi officiis vel quae sequi aspernatur iusto reprehenderit repellendus autem architecto!",
tags: ["coding", "gaming"]
}

const Blogs = () => {
return (
<Section>
<h1> Blogs </h1>
</Section>
);
return (
<Section>
<h1> All Blogs </h1>
<div className="AllBlogs">
<BlogsElements title={blogs.title} author={blogs.author} date={blogs.date} content={blogs.content} tags={blogs.tags}/>
<BlogsElements title={blogs.title} author={blogs.author} date={blogs.date} content={blogs.content} tags={blogs.tags}/>
<BlogsElements title={blogs.title} author={blogs.author} date={blogs.date} content={blogs.content} tags={blogs.tags}/>
<BlogsElements title={blogs.title} author={blogs.author} date={blogs.date} content={blogs.content} tags={blogs.tags}/>
</div>
</Section>
);
};

export default Blogs;
export default Blogs;
29 changes: 29 additions & 0 deletions src/components/Resources/Blogs/BlogsElements.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";
import "./Blog.css";
import image from "./img.jpg";
// const image = require('./img.jpg');

const BlogsElements = (props) => {
return (
<>
<div className="blogs__container">
<div className="blogs__container__title">
<img className="blogImg" src={image} alt="Blog Image" width="360px" height="180px" />
<h2>{props.title}</h2>
<h6>
{props.author} | {props.date}
</h6>
</div>
<div className="blogs__container__content">{props.content.slice(0, 200)}{props.content.length>200?"...":""}</div>
<div className="tags">
tags:
{props.tags.map((tag) => (
<div className="tag">{tag}</div>
))}
</div>
</div>
</>
);
};

export default BlogsElements;
Binary file added src/components/Resources/Blogs/img.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit be4e514

Please sign in to comment.