fix(comments): hide if missing aTag, force render on blog id change

This commit is contained in:
enes 2024-11-13 15:08:43 +01:00
parent 49435c2b50
commit 297de3999c
2 changed files with 3 additions and 1 deletions

View File

@ -196,7 +196,8 @@ export const Comments = ({ addressable, setCommentCount }: Props) => {
<div className='IBMSMSMBSSCommentsWrapper'> <div className='IBMSMSMBSSCommentsWrapper'>
<h4 className='IBMSMSMBSSTitle'>Comments</h4> <h4 className='IBMSMSMBSSTitle'>Comments</h4>
<div className='IBMSMSMBSSComments'> <div className='IBMSMSMBSSComments'>
<CommentForm handleSubmit={handleSubmit} /> {/* Hide comment form is aTag is missing */}
{!!addressable.aTag && <CommentForm handleSubmit={handleSubmit} />}
<Filter <Filter
filterOptions={filterOptions} filterOptions={filterOptions}
setFilterOptions={setFilterOptions} setFilterOptions={setFilterOptions}

View File

@ -299,6 +299,7 @@ export const BlogPage = () => {
)} )}
<div className='IBMSMSplitMainBigSideSec'> <div className='IBMSMSplitMainBigSideSec'>
<Comments <Comments
key={blog.id}
addressable={blog as Addressable} addressable={blog as Addressable}
setCommentCount={setCommentCount} setCommentCount={setCommentCount}
/> />