remove unused thing
This commit is contained in:
parent
c21e193fbf
commit
e16f7941d5
3 changed files with 20 additions and 47 deletions
|
@ -1,5 +0,0 @@
|
|||
import { useCallback, useRef, useState } from 'react'
|
||||
import { Post } from '../posts/posts.ts'
|
||||
import { produce, WritableDraft } from 'immer'
|
||||
|
||||
const PageSize = 20
|
|
@ -1,35 +0,0 @@
|
|||
import { useRef } from 'react'
|
||||
import { useIntersectionLoad } from '../../../hooks/useIntersectionLoad.ts'
|
||||
import { Post } from '../posts/posts.ts'
|
||||
import PostItem from './PostItem.tsx'
|
||||
|
||||
interface FeedViewProps {
|
||||
posts: Post[]
|
||||
onLoadMore: () => Promise<void>
|
||||
addReaction: (postId: string, emoji: string) => void
|
||||
clearReaction: (postId: string, emoji: string) => void
|
||||
}
|
||||
|
||||
export default function FeedView({ posts, onLoadMore, addReaction, clearReaction }: FeedViewProps) {
|
||||
const sentinelRef = useRef<HTMLDivElement | null>(null)
|
||||
|
||||
useIntersectionLoad(onLoadMore, sentinelRef)
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<div className="flex flex-col gap-6 w-full">
|
||||
<div className="flex flex-col gap-6 w-full">
|
||||
{posts.map((post) => (
|
||||
<PostItem
|
||||
key={post.postId}
|
||||
post={post}
|
||||
addReaction={(emoji) => addReaction(post.postId, emoji)}
|
||||
clearReaction={(emoji) => clearReaction(post.postId, emoji)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div ref={sentinelRef} className="h-1" />
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue