pancy fants

This commit is contained in:
john 2025-05-06 12:53:32 +02:00
parent a4fd3a3556
commit b6633d6f25
15 changed files with 339 additions and 116 deletions

View file

@ -4,10 +4,11 @@ import { PostsService } from '../model/posts/postsService.ts'
import { useUserStore } from '../store/userStore.ts'
import { MediaService } from '../model/mediaService.ts'
import NewPostWidget from '../components/NewPostWidget.tsx'
import { useFeedViewModel } from '../feed/feedViewModel.ts'
import { useFeedViewModel } from '../feed/FeedView.ts'
import { Post } from '../model/posts/posts.ts'
import { Temporal } from '@js-temporal/polyfill'
import AppLayout from '../layouts/AppLayout.tsx'
import SingleColumnLayout from '../layouts/SingleColumnLayout.tsx'
import NavBar from '../components/NavBar.tsx'
interface HomePageProps {
postsService: PostsService
@ -26,7 +27,7 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
[postsService],
)
const [pages, setPages, loadNextPage] = useFeedViewModel(fetchPosts)
const { pages, setPages, loadNextPage } = useFeedViewModel(fetchPosts)
const onCreatePost = useCallback(
async (content: string, files: File[]) => {
@ -49,11 +50,11 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
)
return (
<AppLayout>
<SingleColumnLayout navbar={<NavBar />}>
<main className={`w-full max-w-3xl mx-auto`}>
<NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />
<FeedView pages={pages} onLoadMore={loadNextPage} />
</main>
</AppLayout>
</SingleColumnLayout>
)
}