Skip to content

Commit

Permalink
better way to add separator
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Jan 29, 2025
1 parent a23e6c0 commit 91b08ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const EventSummary = (props) => {
</span>
),
item.head_title,
].filter((x) => x);
if (kicker.length > 1) {
kicker = kicker.reduce((prev, curr) => [prev, ' | ', curr]);
}
]
.filter((x) => x)
.flatMap((x) => [' | ', x])
.slice(1);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ const NewsItemSummary = (props) => {
day: 'numeric',
});

let kicker = [
const kicker = [
item.EffectiveDate !== 'None' && item.effective && (
<span className="day" key="day" suppressHydrationWarning>
{formatter.format(new Date(item.effective))}
</span>
),
item.head_title,
].filter((x) => x);
if (kicker.length > 1) {
kicker = kicker.reduce((prev, curr) => [prev, ' | ', curr]);
}
]
.filter((x) => x)
.flatMap((x) => [' | ', x])
.slice(1);

return (
<>
Expand Down

0 comments on commit 91b08ab

Please sign in to comment.