diff --git a/frontend/src/assets/placeholder_profile.png b/frontend/src/assets/placeholder_profile.png new file mode 100644 index 00000000..09892098 Binary files /dev/null and b/frontend/src/assets/placeholder_profile.png differ diff --git a/frontend/src/components/AnswerCard.tsx b/frontend/src/components/AnswerCard.tsx index 8de70cc8..2d70f055 100644 --- a/frontend/src/components/AnswerCard.tsx +++ b/frontend/src/components/AnswerCard.tsx @@ -2,6 +2,7 @@ import { Card } from "@/components/ui/card"; import { ArrowRight, CornerDownRight, Star } from "lucide-react"; import React from "react"; import { Link } from "react-router-dom"; +import placeholderProfile from "@/assets/placeholder_profile.png"; interface AnswerCardProps { id: number; @@ -48,7 +49,8 @@ export const AnswerCard: React.FC = ({
{"Profile diff --git a/frontend/src/components/AnswerItem.tsx b/frontend/src/components/AnswerItem.tsx index 6e519d0d..f750d95d 100644 --- a/frontend/src/components/AnswerItem.tsx +++ b/frontend/src/components/AnswerItem.tsx @@ -6,6 +6,7 @@ import { ThumbsDown, ThumbsUp } from "lucide-react"; import React from "react"; import { Link } from "react-router-dom"; import { ContentWithSnippets } from "./ContentWithSnippets"; +import placeholderProfile from "@/assets/placeholder_profile.png"; interface AnswerItemProps { answer: AnswerDetails; @@ -61,8 +62,7 @@ export const AnswerItem: React.FC = ({ > {"Profile> = ({ {author && ( {author.name} diff --git a/frontend/src/components/QuestionCard.tsx b/frontend/src/components/QuestionCard.tsx index de7e8b79..1fd2ea4e 100644 --- a/frontend/src/components/QuestionCard.tsx +++ b/frontend/src/components/QuestionCard.tsx @@ -4,6 +4,8 @@ import { DifficultyLevel } from "@/services/api/programmingForumSchemas"; import { ArrowRight, MessageSquare, Star, StarsIcon } from "lucide-react"; import React from "react"; import { Link } from "react-router-dom"; +import placeholderProfile from "@/assets/placeholder_profile.png"; + interface QuestionCardProps { id: number; @@ -57,7 +59,8 @@ export const QuestionCard = React.forwardRef( {author && ( {author.name} diff --git a/frontend/src/routes/profile.tsx b/frontend/src/routes/profile.tsx index 14504739..1eb53a9f 100644 --- a/frontend/src/routes/profile.tsx +++ b/frontend/src/routes/profile.tsx @@ -19,6 +19,7 @@ import { Link, useParams } from "react-router-dom"; import { Badge } from "@/components/ui/badge"; import { Textarea } from "@/components/ui/textarea"; +import placeholderProfile from "@/assets/placeholder_profile.png"; export default function Profile() { const { userId = "" } = useParams<{ userId: string }>(); @@ -80,7 +81,7 @@ export default function Profile() {
diff --git a/frontend/src/routes/question.test.tsx b/frontend/src/routes/question.test.tsx index f35209c7..f07d8fc8 100644 --- a/frontend/src/routes/question.test.tsx +++ b/frontend/src/routes/question.test.tsx @@ -17,7 +17,6 @@ import { DifficultyBar } from "@/components/DifficultyBar"; - const mockQuestionData = vi.hoisted( () => ({ diff --git a/frontend/src/routes/question.tsx b/frontend/src/routes/question.tsx index 554585fb..888ea944 100644 --- a/frontend/src/routes/question.tsx +++ b/frontend/src/routes/question.tsx @@ -12,6 +12,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { toast } from "@/components/ui/use-toast"; import { TagDetails } from "@/services/api/programmingForumSchemas"; +import placeholderProfile from "@/assets/placeholder_profile.png"; import { useDeleteQuestion as useDeleteQuestionById, @@ -225,8 +226,7 @@ export default function QuestionPage() { className="flex items-center gap-4" > {"Profile; @@ -141,9 +142,7 @@ export function UserProfile({ userId }: { userId: string }) { {`Profile diff --git a/mobile/app/question/[questionId].tsx b/mobile/app/question/[questionId].tsx index c56ea7e4..4bc103b6 100644 --- a/mobile/app/question/[questionId].tsx +++ b/mobile/app/question/[questionId].tsx @@ -37,6 +37,8 @@ import { } from "lucide-react-native"; import { useEffect, useState } from "react"; import { ScrollView, View } from "react-native"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; + export default function QuestionPage() { const { questionId } = useLocalSearchParams(); const router = useRouter(); @@ -257,11 +259,9 @@ export default function QuestionPage() { className="flex flex-row items-center gap-4" > {question.author.name} = ({ {author.name} diff --git a/mobile/components/AnswerItem.tsx b/mobile/components/AnswerItem.tsx index 004b8edb..3adf4e91 100644 --- a/mobile/components/AnswerItem.tsx +++ b/mobile/components/AnswerItem.tsx @@ -8,6 +8,7 @@ import { ThumbsDown, ThumbsUp } from "lucide-react-native"; import React from "react"; import { View } from "react-native"; import { ContentWithSnippets } from "./ContentWithSnippets"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; interface AnswerItemProps { answer: AnswerDetails; @@ -69,11 +70,7 @@ export const AnswerItem: React.FC = ({ className="flex items-center gap-2" > {answer.author?.name} diff --git a/mobile/components/QuestionCard.tsx b/mobile/components/QuestionCard.tsx index 9e218b0a..c46b20e9 100644 --- a/mobile/components/QuestionCard.tsx +++ b/mobile/components/QuestionCard.tsx @@ -3,6 +3,7 @@ import { DifficultyLevel } from "@/services/api/programmingForumSchemas"; import { Link } from "expo-router"; import { ArrowRight, MessageSquare, Star, StarsIcon } from "lucide-react-native"; import React from "react"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; interface QuestionCardProps { id: string; @@ -62,9 +63,7 @@ export const QuestionCard: React.FC = ({ {author.name diff --git a/mobile/services/api/programmingForumSchemas.ts b/mobile/services/api/programmingForumSchemas.ts index 8c73d7f9..0e0b4664 100644 --- a/mobile/services/api/programmingForumSchemas.ts +++ b/mobile/services/api/programmingForumSchemas.ts @@ -96,7 +96,7 @@ export type UserProfileUpdate = { }; /** - * @example {"id":1,"username":"john_doe","reputationPoints":100,"profilePicture":"https://placehold.co/640x640","name":"John Doe"} + * @example {"id":1,"username":"john_doe","reputationPoints":100,"profilePicture":"@/assets/images/placeholder_profile.png","name":"John Doe"} */ export type UserSummary = { id: number; diff --git a/mobile/services/temporaryMocks.ts b/mobile/services/temporaryMocks.ts index 9e1670e4..c18cdd51 100644 --- a/mobile/services/temporaryMocks.ts +++ b/mobile/services/temporaryMocks.ts @@ -28,7 +28,7 @@ export const temporaryMocks = { id: 2, username: "john_doe", reputationPoints: 100, - profilePicture: "https://placehold.co/640x640", + profilePicture: "@/assets/images/placeholder_profile.png", name: "John Doe", experienceLevel: "INTERMEDIATE" }, @@ -62,7 +62,7 @@ export const temporaryMocks = { id: 1, username: "jane_doe", reputationPoints: 150, - profilePicture: "https://placehold.co/640x640", + profilePicture: "@/assets/images/placeholder_profile.png", name: "Jane Doe", experienceLevel: "EXPERT" }, @@ -83,7 +83,7 @@ export const temporaryMocks = { id: 2, username: "john_doe", reputationPoints: 100, - profilePicture: "https://placehold.co/640x640", + profilePicture: "@/assets/images/placeholder_profile.png", name: "John Doe", experienceLevel: "INTERMEDIATE" },