fix: connect vote button in post actions

This commit is contained in:
MTG2000
2022-06-06 17:46:55 +03:00
parent 9b5b2f82e9
commit 029c78c8ab
3 changed files with 15 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { useEffect, useState } from "react"
import { Helmet } from "react-helmet";
import { BsFillLightningChargeFill } from "react-icons/bs";
import { Grid } from "react-loader-spinner";
import { useNavigate } from "react-router-dom";
@@ -99,6 +100,10 @@ export default function LoginPage() {
return (
<div className="min-h-[80vh] page-container flex flex-col justify-center items-center">
<Helmet>
<title>{`makers.bolt.fun`}</title>
<meta property="og:title" content={`makers.bolt.fun`} />
</Helmet>
{content}
</div>
)

View File

@@ -25,9 +25,15 @@ export default function PostActions({ post, isPreview }: Props) {
},
];
const navigate = useNavigate();
const vote = () => { }
const navigate = useNavigate();
const { vote } = useVote({
itemId: post.id,
itemType: Vote_Item_Type[post.__typename!]
});
return (
<div>

View File

@@ -21,7 +21,8 @@ export const useUpdateStory = (story: Story) => {
deleteStoryId: story.id
},
onError: (error) => NotificationsService.error('Unexpected error happened, please try again', { error }),
onCompleted: () => window.location.pathname = '/blog'
onCompleted: () => window.location.pathname = '/blog',
refetchQueries: ['Feed', 'TrendingPosts']
})
const handleEdit = () => {