Skip to content

Commit

Permalink
chore(collection): locate changes for focusing articles within the co…
Browse files Browse the repository at this point in the history
…llection

re #4546
  • Loading branch information
byhow committed Jun 12, 2024
1 parent 2a36aae commit 9554aca
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions src/views/ArticleDetail/AuthorSidebar/Collection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,32 @@ export const Collection = ({ article, collectionId }: CollectionProps) => {
loader={<ArticleDigestAuthorSidebarFeedPlaceholder />}
>
<List borderPosition="top">
{edges?.map(({ node, cursor }, i) => (
<List.Item key={cursor}>
<ArticleDigestAuthorSidebar
article={node}
titleTextSize={14}
collectionId={collectionId}
titleColor={node.id === article?.id ? 'black' : 'greyDarker'}
showCover={false}
clickEvent={() => {
analytics.trackEvent('click_feed', {
type: 'article_detail_author_sidebar_collection',
contentType: 'article',
location: i,
id: node.id,
})
}}
/>
</List.Item>
))}
{edges?.map(
(
{ node, cursor },
i // TODO: find focus factor
) => (
<List.Item key={cursor}>
<ArticleDigestAuthorSidebar
article={node}
titleTextSize={14}
collectionId={collectionId}
titleColor={
node.id === article?.id ? 'black' : 'greyDarker'
}
showCover={false}
clickEvent={() => {
analytics.trackEvent('click_feed', {
type: 'article_detail_author_sidebar_collection',
contentType: 'article',
location: i,
id: node.id,
})
}}
/>
</List.Item>
)
)}
</List>
</InfiniteScroll>
</section>
Expand Down

0 comments on commit 9554aca

Please sign in to comment.