Refactor feed manipulation and rendering to be more robust (#297)
This commit is contained in:
parent
93df983692
commit
c50a20d214
7 changed files with 360 additions and 260 deletions
28
src/view/com/posts/FeedSlice.tsx
Normal file
28
src/view/com/posts/FeedSlice.tsx
Normal 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}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue