From c89f78acbc17facc48c71cc10aace0fc07ff43a2 Mon Sep 17 00:00:00 2001 From: Nazire Date: Sat, 14 Dec 2024 17:15:30 +0300 Subject: [PATCH 1/3] Added default profile picture. --- frontend/src/assets/placeholder_profile.png | Bin 0 -> 2011 bytes frontend/src/components/AnswerCard.tsx | 4 +++- frontend/src/components/AnswerItem.tsx | 4 ++-- .../src/components/HighlightedQuestionCard.tsx | 3 ++- frontend/src/components/QuestionCard.tsx | 5 ++++- frontend/src/routes/profile.tsx | 2 +- frontend/src/routes/question.test.tsx | 3 ++- frontend/src/routes/question.tsx | 4 ++-- .../src/services/api/programmingForumSchemas.ts | 2 +- frontend/src/services/temporaryMocks.ts | 6 +++--- mobile/app/(tabs)/profile.tsx | 2 +- mobile/app/question/[questionId].tsx | 5 +++-- mobile/components/AnswerCard.tsx | 3 ++- mobile/components/AnswerItem.tsx | 4 ++-- mobile/components/QuestionCard.tsx | 3 ++- mobile/services/api/programmingForumSchemas.ts | 2 +- mobile/services/temporaryMocks.ts | 6 +++--- swagger/openapi.yml | 2 +- 18 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 frontend/src/assets/placeholder_profile.png diff --git a/frontend/src/assets/placeholder_profile.png b/frontend/src/assets/placeholder_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..09892098aa943af5fe95e7dd434a07fe03e7ccd1 GIT binary patch literal 2011 zcmV<12PF83P)D!y%g4vZ*x1<2%*?Q`u)x5;+S=OH)zz}HvdGBD zw6wIs!oteR%FWHqrlzLJ$;r^r(7(UGt*x!9s;a}o!>FjJ#>U3Iy}i%R&$YF+x3{;h zuCCtR-nO>3udlDMv9Z$9(zv*|ySuyA*4EqG+ZlWNivR!y*-1n}RCr$O+*gj>NDPM2 zpNco<96RTn9rwSi8F&oCZFlz#Qq{xgJ4+x4LZrx&UjP6A00000000000000000000 z0000000000h)13Iv~gIg9X6)(&Ma2$kko6>k^LchuGJIe1?9VT%ih&$-<6da;(GtY zRygU`V`YKSGPJdX%aOK)>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LkV1gNB=am2e literal 0 HcmV?d00001 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..d7bb22d9 100644 --- a/frontend/src/routes/profile.tsx +++ b/frontend/src/routes/profile.tsx @@ -80,7 +80,7 @@ export default function Profile() {
diff --git a/frontend/src/routes/question.test.tsx b/frontend/src/routes/question.test.tsx index f35209c7..e35bf136 100644 --- a/frontend/src/routes/question.test.tsx +++ b/frontend/src/routes/question.test.tsx @@ -14,6 +14,7 @@ import { beforeEach, describe, expect, it, Mock, vi } from "vitest"; import { routeConfig } from "."; import QuestionPage from "./question"; import { DifficultyBar } from "@/components/DifficultyBar"; +import placeholderProfile from "@/assets/placeholder_profile.png"; @@ -29,7 +30,7 @@ const mockQuestionData = vi.hoisted( username: "johndoe", name: "John Doe", reputationPoints: 100, - profilePicture: "https://example.com/profile.jpg", + profilePicture: placeholderProfile, }, likeCount: 10, commentCount: 5, 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 {`Profile = ({ {author.name} diff --git a/mobile/components/AnswerItem.tsx b/mobile/components/AnswerItem.tsx index 004b8edb..fd3c697b 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/placeholder_profile.png"; interface AnswerItemProps { answer: AnswerDetails; @@ -71,8 +72,7 @@ export const AnswerItem: React.FC = ({ {answer.author?.name} = ({ {author.name Date: Sat, 14 Dec 2024 17:39:58 +0300 Subject: [PATCH 2/3] fixed test --- frontend/src/routes/question.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/routes/question.test.tsx b/frontend/src/routes/question.test.tsx index e35bf136..f35209c7 100644 --- a/frontend/src/routes/question.test.tsx +++ b/frontend/src/routes/question.test.tsx @@ -14,7 +14,6 @@ import { beforeEach, describe, expect, it, Mock, vi } from "vitest"; import { routeConfig } from "."; import QuestionPage from "./question"; import { DifficultyBar } from "@/components/DifficultyBar"; -import placeholderProfile from "@/assets/placeholder_profile.png"; @@ -30,7 +29,7 @@ const mockQuestionData = vi.hoisted( username: "johndoe", name: "John Doe", reputationPoints: 100, - profilePicture: placeholderProfile, + profilePicture: "https://example.com/profile.jpg", }, likeCount: 10, commentCount: 5, From 68825360390d00906311a0b561475a67f897d8ea Mon Sep 17 00:00:00 2001 From: Nazire Date: Sat, 14 Dec 2024 18:14:05 +0300 Subject: [PATCH 3/3] fixed based on review --- frontend/src/routes/profile.tsx | 3 ++- frontend/src/routes/question.test.tsx | 1 - mobile/app/(tabs)/profile.tsx | 5 ++--- mobile/app/question/[questionId].tsx | 9 ++++----- mobile/assets/images/placeholder_profile.png | Bin 0 -> 2011 bytes mobile/components/AnswerCard.tsx | 4 ++-- mobile/components/AnswerItem.tsx | 7 ++----- mobile/components/QuestionCard.tsx | 6 ++---- mobile/services/api/programmingForumSchemas.ts | 2 +- mobile/services/temporaryMocks.ts | 6 +++--- swagger/openapi.yml | 2 +- 11 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 mobile/assets/images/placeholder_profile.png diff --git a/frontend/src/routes/profile.tsx b/frontend/src/routes/profile.tsx index d7bb22d9..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/mobile/app/(tabs)/profile.tsx b/mobile/app/(tabs)/profile.tsx index 3e472ebe..bdbef758 100644 --- a/mobile/app/(tabs)/profile.tsx +++ b/mobile/app/(tabs)/profile.tsx @@ -37,6 +37,7 @@ import useAuthStore from "@/services/auth"; import { Link, router } from "expo-router"; import { ChevronDownIcon, Plus, Bookmark, MenuIcon, LogOutIcon } from "lucide-react-native"; import { useEffect, useState } from "react"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; export default function Profile() { return ; @@ -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 6ac3d6ea..4bc103b6 100644 --- a/mobile/app/question/[questionId].tsx +++ b/mobile/app/question/[questionId].tsx @@ -37,7 +37,7 @@ import { } from "lucide-react-native"; import { useEffect, useState } from "react"; import { ScrollView, View } from "react-native"; -import placeholderProfile from "@/assets/placeholder_profile.png"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; export default function QuestionPage() { const { questionId } = useLocalSearchParams(); @@ -259,10 +259,9 @@ export default function QuestionPage() { className="flex flex-row items-center gap-4" > {question.author.name}D!y%g4vZ*x1<2%*?Q`u)x5;+S=OH)zz}HvdGBD zw6wIs!oteR%FWHqrlzLJ$;r^r(7(UGt*x!9s;a}o!>FjJ#>U3Iy}i%R&$YF+x3{;h zuCCtR-nO>3udlDMv9Z$9(zv*|ySuyA*4EqG+ZlWNivR!y*-1n}RCr$O+*gj>NDPM2 zpNco<96RTn9rwSi8F&oCZFlz#Qq{xgJ4+x4LZrx&UjP6A00000000000000000000 z0000000000h)13Iv~gIg9X6)(&Ma2$kko6>k^LchuGJIe1?9VT%ih&$-<6da;(GtY zRygU`V`YKSGPJdX%aOK)>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LkV1gNB=am2e literal 0 HcmV?d00001 diff --git a/mobile/components/AnswerCard.tsx b/mobile/components/AnswerCard.tsx index effa2550..55f44f10 100644 --- a/mobile/components/AnswerCard.tsx +++ b/mobile/components/AnswerCard.tsx @@ -5,7 +5,7 @@ import { ArrowRight, CornerDownRight, Star } from "lucide-react-native"; import React from "react"; import { View } from "react-native"; import { ContentWithSnippets } from "./ContentWithSnippets"; -import placeholderProfile from "@/assets/placeholder_profile.png"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; interface AnswerCardProps { id: string; @@ -47,7 +47,7 @@ export const AnswerCard: React.FC = ({ {author.name} diff --git a/mobile/components/AnswerItem.tsx b/mobile/components/AnswerItem.tsx index fd3c697b..3adf4e91 100644 --- a/mobile/components/AnswerItem.tsx +++ b/mobile/components/AnswerItem.tsx @@ -8,7 +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/placeholder_profile.png"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; interface AnswerItemProps { answer: AnswerDetails; @@ -70,10 +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 bff6e427..c46b20e9 100644 --- a/mobile/components/QuestionCard.tsx +++ b/mobile/components/QuestionCard.tsx @@ -3,7 +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/placeholder_profile.png"; +import placeholderProfile from "@/assets/images/placeholder_profile.png"; interface QuestionCardProps { id: string; @@ -63,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 77542aad..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":"frontend\src\assets\placeholder_profile.png","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 96fe9c5b..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: "frontend\src\assets\placeholder_profile.png", + 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: "frontend\src\assets\placeholder_profile.png", + 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: "frontend\src\assets\placeholder_profile.png", + profilePicture: "@/assets/images/placeholder_profile.png", name: "John Doe", experienceLevel: "INTERMEDIATE" }, diff --git a/swagger/openapi.yml b/swagger/openapi.yml index b76b58ad..c5f3a194 100644 --- a/swagger/openapi.yml +++ b/swagger/openapi.yml @@ -1354,7 +1354,7 @@ components: - id: 1 username: "john_doe" reputationPoints: 100 - profilePicture: "frontend\src\assets\placeholder_profile.png" + profilePicture: "https://placehold.co/640x640" name: "John Doe" DifficultyLevel: