Skip to content

Commit

Permalink
Fix/blog UI changes (#49)
Browse files Browse the repository at this point in the history
* fix(blog): Show pagination properly

* fix(blog): Fix card clicking area

* fix(blog): Add space between multilined tags
  • Loading branch information
Nirajn2311 authored Apr 9, 2021
1 parent 69d018c commit 98dda16
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
38 changes: 20 additions & 18 deletions src/components/Blogs/BlogCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@ class BlogCard extends Component {
render() {
return (
<>
<Link to={"/blog/" + this.state.heading + "?id=" + this.props.blogsid} className="col-12" style={{ textDecoration: 'none' }}>
<div className="col-12 m-0">
<div className="blog-card my-2">
<div className="meta">
<div className="photo" style={{ background: this.props.color }}><span ref={this.headingFirstChar}></span></div>
<ul className="details">
<li className="author py-3">{this.props.writer}</li>
<li className="date">{this.props.date}</li>
</ul>
<div className="col-12">
<div className='blog-card-container'>
<Link to={"/blog/" + this.state.heading + "?id=" + this.props.blogsid} style={{ textDecoration: 'none' }}>
<div className="blog-card">
<div className="meta">
<div className="photo" style={{ background: this.props.color }}><span ref={this.headingFirstChar}></span></div>
<ul className="details">
<li className="author py-3">{this.props.writer}</li>
<li className="date">{this.props.date}</li>
</ul>
</div>
<div className="description text-dark ">
<h1 className="py-3" >{this.props.heading}</h1>
<p ref={this.htmlContent} className="py-1"> </p>
<ul className="tags list-inline pt-2">
{this.state.tagList}
</ul>
</div>
</div>
<div className="description text-dark ">
<h1 className="py-3" >{this.props.heading}</h1>
<p ref={this.htmlContent} className="py-1"> </p>
<ul className="tags list-inline pt-2">
{this.state.tagList}
</ul>
</div>
</div>
</Link>
</div>
</Link>
</div>
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Blogs/BlogsHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class BlogHome extends React.Component {
{loaderContent}
</div>
{blogstoshow}
<div className="col-12 pt-2 d-flex justify-content-center ">
<div className="col-12 py-4 d-flex justify-content-center ">
<ReactPaginate pageCount={noOfPages}
onPageChange={this.handlePageClick}
breakClassName={'page-item'}
Expand Down
7 changes: 7 additions & 0 deletions src/styles/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ user-select: none;
color: #16181a !important ;

}

.blog-card-container {
max-width: 800px;
margin: 0 auto;
}

.blog-card {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -248,6 +254,7 @@ user-select: none;
padding: 5px 10px;
border-radius: 4px;
text-transform: capitalize;
margin-bottom: 0.5rem;
}
.blog-card .description .tags li a:hover{
color: white;
Expand Down

0 comments on commit 98dda16

Please sign in to comment.