Skip to content

Commit

Permalink
refactor: enhance readability by restructuring Feed and FeedItem comp…
Browse files Browse the repository at this point in the history
…onents
  • Loading branch information
simlarsen committed Jan 15, 2025
1 parent e20624a commit a0f6e97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Common/UI/Components/Feed/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ const Feed: FunctionComponent<ComponentProps> = (
</div>
)}
{props.items.map((item: FeedItemProps, index: number) => {
return <FeedItem {...item}

isLastItem={index === props.items.length - 1}
/>;
return (
<FeedItem {...item} isLastItem={index === props.items.length - 1} />
);
})}
</ul>
</div>
Expand Down
10 changes: 6 additions & 4 deletions Common/UI/Components/Feed/FeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ const FeedItem: FunctionComponent<ComponentProps> = (
return (
<li key={props.key}>
<div className="relative pb-8">
{!props.isLastItem && <span
className="absolute left-5 top-5 -ml-px h-full w-0.5 bg-gray-200"
aria-hidden="true"
></span>}
{!props.isLastItem && (
<span
className="absolute left-5 top-5 -ml-px h-full w-0.5 bg-gray-200"
aria-hidden="true"
></span>
)}
<div className="relative flex items-start space-x-3">
<div className="relative">
{props.user && getUserIcon()}
Expand Down

0 comments on commit a0f6e97

Please sign in to comment.