Refactor feed manipulation and rendering to be more robust (#297)

This commit is contained in:
Paul Frazee 2023-03-16 15:54:06 -05:00 committed by GitHub
parent 93df983692
commit c50a20d214
7 changed files with 360 additions and 260 deletions

View file

@ -0,0 +1,28 @@
import React from 'react'
import {FeedSliceModel} from 'state/models/feed-view'
import {FeedItem} from './FeedItem'
export function FeedSlice({
slice,
showFollowBtn,
ignoreMuteFor,
}: {
slice: FeedSliceModel
showFollowBtn?: boolean
ignoreMuteFor?: string
}) {
return (
<>
{slice.items.map((item, i) => (
<FeedItem
key={item._reactKey}
item={item}
isThreadParent={slice.isThreadParentAt(i)}
isThreadChild={slice.isThreadChildAt(i)}
showFollowBtn={showFollowBtn}
ignoreMuteFor={ignoreMuteFor}
/>
))}
</>
)
}