-
{author}
-
{content}
+
+
+
+
+

+
{authorName}
+
+ Posted on: {format(createdAt, 'Pp')}
+
+
+
{content}
);
}
+
+const AnswerCard = withHref(AnswerCardWithoutHref);
+export default AnswerCard;
diff --git a/apps/portal/src/components/questions/card/FullQuestionCard.tsx b/apps/portal/src/components/questions/card/FullQuestionCard.tsx
new file mode 100644
index 00000000..936c6416
--- /dev/null
+++ b/apps/portal/src/components/questions/card/FullQuestionCard.tsx
@@ -0,0 +1,68 @@
+import { Badge } from '@tih/ui';
+
+import VotingButtons from '../VotingButtons';
+
+type UpvoteProps =
+ | {
+ showVoteButtons: true;
+ upvoteCount: number;
+ }
+ | {
+ showVoteButtons?: false;
+ upvoteCount?: never;
+ };
+
+export type FullQuestionCardProps = UpvoteProps & {
+ company: string;
+ content: string;
+ href?: string;
+ location: string;
+ receivedCount: number;
+ role: string;
+ timestamp: string;
+};
+
+export default function FullQuestionCard({
+ company,
+ content,
+ showVoteButtons,
+ upvoteCount,
+ timestamp,
+ role,
+ location,
+ href,
+}: FullQuestionCardProps) {
+ const altText = company + ' logo';
+ const mainCard = (
+
+ {showVoteButtons && }
+
+
+

+
{company}
+
+
+
+
+
+ {timestamp} · {location} · {role}
+
+
+
+
+
+
+ );
+
+ return href ? (
+
+ {mainCard}
+
+ ) : (
+ mainCard
+ );
+}
diff --git a/apps/portal/src/components/questions/card/QuestionCard.tsx b/apps/portal/src/components/questions/card/QuestionCard.tsx
index 08c1b7be..3b4ed8c5 100644
--- a/apps/portal/src/components/questions/card/QuestionCard.tsx
+++ b/apps/portal/src/components/questions/card/QuestionCard.tsx
@@ -1,6 +1,6 @@
import {
ChatBubbleBottomCenterTextIcon,
- EyeIcon,
+ // EyeIcon,
} from '@heroicons/react/24/outline';
import { Badge, Button } from '@tih/ui';
@@ -52,7 +52,7 @@ export type QuestionCardProps = ActionButtonProps &
export default function QuestionCard({
answerCount,
content,
- receivedCount,
+ // ReceivedCount,
showVoteButtons,
showUserStatistics,
showActionButton,
@@ -62,9 +62,8 @@ export default function QuestionCard({
timestamp,
role,
location,
- href,
}: QuestionCardProps) {
- const mainCard = (
+ return (
{showVoteButtons && }
@@ -96,26 +95,16 @@ export default function QuestionCard({
size="sm"
variant="tertiary"
/>
-
+ /> */}
)}
- ) : (
- mainCard
- );
}
diff --git a/apps/portal/src/components/questions/card/QuestionOverviewCard.tsx b/apps/portal/src/components/questions/card/QuestionOverviewCard.tsx
index ecb4eb2e..fa786917 100644
--- a/apps/portal/src/components/questions/card/QuestionOverviewCard.tsx
+++ b/apps/portal/src/components/questions/card/QuestionOverviewCard.tsx
@@ -1,3 +1,5 @@
+import withHref from '~/utils/questions/withHref';
+
import type { QuestionCardProps } from './QuestionCard';
import QuestionCard from './QuestionCard';
@@ -14,7 +16,7 @@ export type QuestionOverviewCardProps = Omit<
| 'showVoteButtons'
>;
-export default function QuestionOverviewCard(props: QuestionOverviewCardProps) {
+function QuestionOverviewCardWithoutHref(props: QuestionOverviewCardProps) {
return (
);
}
+
+const QuestionOverviewCard = withHref(QuestionOverviewCardWithoutHref);
+export default QuestionOverviewCard;