add and remove reactions
This commit is contained in:
parent
dab626f227
commit
48e7094c5e
6 changed files with 185 additions and 39 deletions
|
@ -63,6 +63,14 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
|
|||
|
||||
const isLoggedIn = user != null
|
||||
|
||||
const addReaction = async (postId: string, emoji: string) => {
|
||||
await postsService.addReaction(postId, emoji)
|
||||
}
|
||||
|
||||
const clearReaction = async (postId: string, emoji: string) => {
|
||||
await postsService.removeReaction(postId, emoji)
|
||||
}
|
||||
|
||||
return (
|
||||
<SingleColumnLayout
|
||||
navbar={
|
||||
|
@ -73,7 +81,12 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
|
|||
>
|
||||
<main className={`w-full max-w-3xl mx-auto`}>
|
||||
{isLoggedIn && <NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />}
|
||||
<FeedView pages={pages} onLoadMore={loadNextPage} />
|
||||
<FeedView
|
||||
pages={pages}
|
||||
onLoadMore={loadNextPage}
|
||||
addReaction={addReaction}
|
||||
clearReaction={clearReaction}
|
||||
/>
|
||||
</main>
|
||||
</SingleColumnLayout>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue