Skip to content

Commit

Permalink
fix edit blog button always shown issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lishenyu16 committed Apr 7, 2020
1 parent 8265a97 commit 36bc545
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions inspiredblog/src/pages/index/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ const App = (props) => {
<Route path='/blogs/forgot-password' component = {ForgotPassword}></Route>

<Route path='/blogs/confirm-email/:code/:userId' component = {EmailConfirmed}></Route>
{/* below are protected(page can't be refreshed) routes */}
<Route path='/blogs/verification' component = {Verification}></Route>
<Route path='/blogs/reset-password/:code/:userId' component = {ResetPassword}></Route>
{/* End of protected */}

<Route path='/blogs/profile' component = {Profile}></Route>
<Route path='/blogs/blog-detail/:blog_id' component = {BlogDetail}></Route>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const BlogDetail = (props) => {
arrow_back_ios
</span>
</div>
<div className={classes.editBlog} style={{cursor:'pointer', display:checkAuthState()?'':'none'}} onClick={clickEdit}>
<div className={classes.editBlog} style={{cursor:'pointer', display:!checkAuthState()?'none':localStorage.getItem('user_id')==props.blog.blogDetail.user_id?'':'none'}} onClick={clickEdit}>
Edit
</div>
<div className={classes.title}>{props.blog.blogDetail.blog_title}</div>
Expand Down

0 comments on commit 36bc545

Please sign in to comment.