Skip to content

Commit

Permalink
Render annotation cards as list items
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Feb 12, 2024
1 parent 1e58310 commit 5b56408
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/sidebar/components/ThreadList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,28 +277,30 @@ export default function ThreadList({ threads }: ThreadListProps) {
return (
<div>
<div style={{ height: offscreenUpperHeight }} />
{visibleThreads.map(child => (
<div
className={classnames(
// The goal is to space out each annotation card vertically. Typically
// this is better handled by applying vertical spacing to the parent
// element (e.g. `space-y-3`) but in this case, the constraints of
// sibling divs before and after the list of annotation cards prevents
// this, so a bottom margin is added to each card's wrapping element.
'mb-3',
)}
data-testid="thread-card-container"
id={child.id}
key={child.id}
>
{headings.get(child) && (
<h3 className="text-md text-grey-7 font-bold pt-3 pb-2">
{headings.get(child)}
</h3>
)}
<ThreadCard thread={child} />
</div>
))}
<ul>
{visibleThreads.map(child => (
<li
className={classnames(
// The goal is to space out each annotation card vertically. Typically
// this is better handled by applying vertical spacing to the parent
// element (e.g. `space-y-3`) but in this case, the constraints of
// sibling divs before and after the list of annotation cards prevents
// this, so a bottom margin is added to each card's wrapping element.
'mb-3',
)}
data-testid="thread-card-container"
id={child.id}
key={child.id}
>
{headings.get(child) && (
<h3 className="text-md text-grey-7 font-bold pt-3 pb-2">
{headings.get(child)}
</h3>
)}
<ThreadCard thread={child} />
</li>
))}
</ul>
<div style={{ height: offscreenLowerHeight }} />
</div>
);
Expand Down

0 comments on commit 5b56408

Please sign in to comment.