remove unused thing

This commit is contained in:
john 2025-05-28 22:08:15 +02:00
parent c21e193fbf
commit e16f7941d5
3 changed files with 20 additions and 47 deletions

View file

@ -1,5 +1,4 @@
import { useCallback, useRef, useState } from 'react'
import FeedView from '../components/FeedView.tsx'
import { PostsService } from '../posts/postsService.ts'
import { useUser } from '../../user/user.ts'
import { MediaService } from '../../media/mediaService.ts'
@ -10,6 +9,8 @@ import AuthNavButtons from '../../auth/components/AuthNavButtons.tsx'
import { useSaveSignupCodeToLocalStorage } from '../../../hooks/useSaveSignupCodeToLocalStorage.ts'
import { Post } from '../posts/posts.ts'
import { produce, WritableDraft } from 'immer'
import PostItem from '../components/PostItem.tsx'
import { useIntersectionLoad } from '../../../hooks/useIntersectionLoad.ts'
interface HomePageProps {
postsService: PostsService
@ -126,6 +127,9 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
)
}
const sentinelRef = useRef<HTMLDivElement | null>(null)
useIntersectionLoad(loadNextPage, sentinelRef)
return (
<SingleColumnLayout
navbar={
@ -136,12 +140,21 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
>
<main className={`w-full max-w-3xl mx-auto`}>
{isLoggedIn && <NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />}
<FeedView
posts={posts}
onLoadMore={loadNextPage}
addReaction={onAddReaction}
clearReaction={onClearReaction}
/>
<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) => onAddReaction(post.postId, emoji)}
clearReaction={(emoji) => onClearReaction(post.postId, emoji)}
/>
))}
</div>
</div>
<div ref={sentinelRef} className="h-1" />
</div>
</main>
</SingleColumnLayout>
)