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 (
); diff --git a/apps/portal/src/components/questions/card/QuestionCard.tsx b/apps/portal/src/components/questions/card/QuestionCard.tsx index 75e95dd2..b643f031 100644 --- a/apps/portal/src/components/questions/card/QuestionCard.tsx +++ b/apps/portal/src/components/questions/card/QuestionCard.tsx @@ -41,6 +41,7 @@ type ActionButtonProps = export type QuestionCardProps = ActionButtonProps & StatisticsProps & UpvoteProps & { + company: string; content: string; href?: string; location: string; @@ -51,6 +52,7 @@ export type QuestionCardProps = ActionButtonProps & }; export default function QuestionCard({ + company, answerCount, content, // ReceivedCount, @@ -70,7 +72,8 @@ export default function QuestionCard({ {showVoteButtons && }
-
+
+

{company}

{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..77d6c1a1 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({ mode: 'onChange' }); const answerRegister = useFormRegister(ansRegister); @@ -86,6 +87,7 @@ export default function QuestionPage() { content: data.answerContent, questionId: questionId as string, }); + resetAnswer(); }; const handleSubmitComment = (data: QuestionCommentData) => { @@ -124,7 +126,7 @@ export default function QuestionPage() { upvoteCount={question.numVotes} />

- +
@@ -199,7 +201,7 @@ export default function QuestionPage() { />
-

{question.numAnswers} answers

+

{(answers ?? []).length} answers

Sort by: diff --git a/apps/portal/src/pages/questions/index.tsx b/apps/portal/src/pages/questions/index.tsx index 776a3f72..daecd35e 100644 --- a/apps/portal/src/pages/questions/index.tsx +++ b/apps/portal/src/pages/questions/index.tsx @@ -184,7 +184,6 @@ export default function QuestionsHomePage() { if (!loaded) { return null; } - const filterSidebar = (