Skip to content

Commit 5b08534

Browse files
authored
Retry the refactor 😅
1 parent 2ab4333 commit 5b08534

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎components/Press/PressLinks/ArticleGroup/ArticleGroup.js‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ class ArticleGroup extends Component {
3232
<h2>{region}</h2>
3333
<ul>
3434
{articles.map((link, index) => {
35-
if (index < numberOfInitiallyVisibleLinks && areAllLinksVisible) {
36-
return (
37-
<li key={`GroupLink_${link.url}`}>
38-
<OutboundLink href={link.url}>{link.title}</OutboundLink>
39-
</li>
40-
);
41-
}
42-
43-
return null;
35+
const isArticleVisible = areAllLinksVisible || index < numberOfInitiallyVisibleLinks;
36+
37+
return isArticleVisible ? (
38+
<li key={`GroupLink_${link.url}`}>
39+
<OutboundLink href={link.url}>{link.title}</OutboundLink>
40+
</li>
41+
) : null;
4442
})}
4543
</ul>
4644
{articles.length > numberOfInitiallyVisibleLinks && (

0 commit comments

Comments
 (0)