wip add button and feed stuff
This commit is contained in:
parent
38d09a582c
commit
1c2d6d60a6
11 changed files with 211 additions and 46 deletions
14
src/pages/HomePage.tsx
Normal file
14
src/pages/HomePage.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { useCallback } from 'react'
|
||||
import { Post } from '../model/posts/posts.ts'
|
||||
import './FeedView.css'
|
||||
import { loadPublicFeed } from '../api/api.ts'
|
||||
import FeedView from './FeedView.tsx'
|
||||
|
||||
export default function HomePage() {
|
||||
const fetchPosts = useCallback(async (cursor: string | null, amount: number | null) => {
|
||||
const result = await loadPublicFeed(cursor, amount)
|
||||
return result.posts.map((post) => Post.fromDto(post))
|
||||
}, [])
|
||||
|
||||
return <FeedView loadPosts={fetchPosts} />
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue