diff --git a/apps/portal/src/components/questions/VotingButtons.tsx b/apps/portal/src/components/questions/VotingButtons.tsx index 74b9193e..51b96b34 100644 --- a/apps/portal/src/components/questions/VotingButtons.tsx +++ b/apps/portal/src/components/questions/VotingButtons.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; import type { ButtonSize } from '@tih/ui'; import { Button } from '@tih/ui'; @@ -11,6 +12,21 @@ export default function VotingButtons({ upvoteCount, size = 'md', }: VotingButtonsProps) { + const handleUpvote = (event: React.MouseEvent) => { + event.preventDefault(); + + event.stopPropagation(); + console.log('upvote'); + }; + + const handleDownVote = (event: React.MouseEvent) => { + event.preventDefault(); + + event.stopPropagation(); + + console.log('downvote'); + }; + return (
{upvoteCount}
{timestamp} · {location} · {role}
diff --git a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx
index aac0a7a2..d1c0e2a8 100644
--- a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx
+++ b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx
@@ -47,7 +47,7 @@ export default function QuestionPage() {
'questions.answers.comments.create',
{
onSuccess: () => {
- utils.invalidateQuery([
+ utils.invalidateQueries([
'questions.answers.comments.getAnswerComments',
{ answerId: answerId as string },
]);
diff --git a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
index f75fb1cb..29233351 100644
--- a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
+++ b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx
@@ -29,6 +29,7 @@ export default function QuestionPage() {
const {
register: ansRegister,
handleSubmit,
+ reset: resetAnswer,
formState: { isDirty, isValid },
} = useForm