Comments: don't show Expand button if no comments
## Issue In Medium layout, the Expand/Collapse button would still appear even for 0 comments. ## Approach Hide the button when comments = 0, but didn't hide the section because the separator line feels useful as a visual guide to mark the sections.
This commit is contained in:
parent
ee03749574
commit
5380bc04f2
1 changed files with 2 additions and 2 deletions
|
@ -302,7 +302,7 @@ export default function CommentList(props: Props) {
|
||||||
|
|
||||||
{!hasDefaultExpansion && (
|
{!hasDefaultExpansion && (
|
||||||
<div className="card__bottom-actions--comments">
|
<div className="card__bottom-actions--comments">
|
||||||
{(!expandedComments || moreBelow) && (
|
{(!expandedComments || moreBelow) && totalComments > 0 && (
|
||||||
<Button
|
<Button
|
||||||
button="link"
|
button="link"
|
||||||
title={!expandedComments ? __('Expand') : __('More')}
|
title={!expandedComments ? __('Expand') : __('More')}
|
||||||
|
@ -310,7 +310,7 @@ export default function CommentList(props: Props) {
|
||||||
onClick={() => (!expandedComments ? setExpandedComments(true) : setPage(page + 1))}
|
onClick={() => (!expandedComments ? setExpandedComments(true) : setPage(page + 1))}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{expandedComments && (
|
{expandedComments && totalComments > 0 && (
|
||||||
<Button
|
<Button
|
||||||
button="link"
|
button="link"
|
||||||
title={__('Collapse')}
|
title={__('Collapse')}
|
||||||
|
|
Loading…
Reference in a new issue