Skip to content

Commit

Permalink
Merge pull request #564 from bounswe/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtftr authored Nov 24, 2024
2 parents 91113e7 + 72a9b34 commit 7227ea9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
24 changes: 15 additions & 9 deletions frontend/src/components/Tag.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { AspectRatio } from "@/components/ui/aspect-ratio";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
// import { useMemo } from "react";
// import { flag } from "country-emoji";
import { Link } from "react-router-dom";
import { Plus } from "lucide-react";
import useAuthStore from "@/services/auth";
import { TagDetails } from "@/services/api/programmingForumSchemas";

import useAuthStore from "@/services/auth";
import { Plus } from "lucide-react";
import { Link } from "react-router-dom";

export const Tag = ({
tag: { id, name, photo, description},
tag: { tagId, name, photo, description },
}: {
tag: TagDetails;
}) => {
Expand All @@ -19,7 +18,12 @@ export const Tag = ({
<div className="flex flex-col self-stretch justify-self-stretch">
<div className="-mb-16 w-[70%] self-center">
<AspectRatio ratio={16 / 9}>
<img src={photo} alt={`The logo image of ${Tag.name}`} title={`alt:The logo image of ${Tag.name}`} className="h-full w-full rounded-2xl object-cover" />
<img
src={photo}
alt={`The logo image of ${Tag.name}`}
title={`alt:The logo image of ${Tag.name}`}
className="h-full w-full rounded-2xl object-cover"
/>
</AspectRatio>
</div>

Expand All @@ -33,12 +37,14 @@ export const Tag = ({
<p className="text-sm text-gray-700">{description}</p>
<div className="flex items-center justify-between">
{!!token && (
<Link to={`/questions/new?tagId=` + encodeURIComponent(id || "")}>
<Link
to={`/questions/new?tagId=` + encodeURIComponent(tagId || "")}
>
<Plus className="h-4 w-4" />
</Link>
)}
<Link
to={`/tag/${id}`}
to={`/tag/${tagId}`}
className="text-sm font-medium text-blue-500 hover:underline"
>
See all questions →
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/routes/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ export default function Profile() {
key={question.id}
id={question.id}
title={question.title}
content={question.content}
votes={question.rating}
answerCount={question.answerCount}
content={question.questionBody ?? ""}
votes={question.likeCount}
answerCount={question.commentCount}
author={question.author}
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function TagPage() {
size="icon"
className="rounded-full bg-red-500 text-white"
>
<Link to={`/questions/new?tagId=${tag.id}`}>
<Link to={`/questions/new?tagId=${tag.tagId}`}>
<Plus />
</Link>
</Button>
Expand Down

0 comments on commit 7227ea9

Please sign in to comment.