From e31be31b61e73264f5b33f636d4ec5fce86a4626 Mon Sep 17 00:00:00 2001 From: Rinat Tabaev Date: Sat, 23 Sep 2023 17:47:50 +0300 Subject: [PATCH] fix: image imports --- src/components/Auth.tsx | 3 ++- src/components/Profile/AvatarImage.tsx | 3 ++- src/components/likedposts/LikedHeader.tsx | 11 +++++++---- src/hooks/useQueryHooks/useComments.tsx | 2 +- src/methods/methods.ts | 1 + 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/Auth.tsx b/src/components/Auth.tsx index da8fb17..b3cc0ca 100644 --- a/src/components/Auth.tsx +++ b/src/components/Auth.tsx @@ -12,6 +12,7 @@ import { DocumentData, } from "firebase/firestore"; import MeetsLogoIcon from "../assets/meets-logo.svg"; +import GoogleIcon from '../assets/google-icon.svg' import useGeneralContext from "../hooks/useContextHooks/useGeneralContext"; export const Auth = () => { @@ -64,7 +65,7 @@ export const Auth = () => {

Sign in with Google

diff --git a/src/components/Profile/AvatarImage.tsx b/src/components/Profile/AvatarImage.tsx index e51518f..3e42aaf 100644 --- a/src/components/Profile/AvatarImage.tsx +++ b/src/components/Profile/AvatarImage.tsx @@ -1,6 +1,7 @@ import { memo } from "react"; import { useDispatch } from "react-redux"; import { setOpenPopupType } from "../../features/modal/modalSlice"; +import EditPopupIcon from '../../assets/editPopupIcon.svg' type AvatarImageProps = { userPicture: string; @@ -20,7 +21,7 @@ const AvatarImage = ({ userPicture }: AvatarImageProps) => { /> edit profile icon diff --git a/src/components/likedposts/LikedHeader.tsx b/src/components/likedposts/LikedHeader.tsx index cef914c..4e9b294 100644 --- a/src/components/likedposts/LikedHeader.tsx +++ b/src/components/likedposts/LikedHeader.tsx @@ -1,11 +1,14 @@ import { Link } from "react-router-dom"; import Signout from "../Signout/Signout"; +import MeetsLogoIcon from '../../assets/meets-logo.svg' +import SearchIcon from '../../assets/icons8-search.svg' +import ProfileIcon from '../../../public/profile-icon.svg' const LikedHeader = () => { return (
Meets-logo @@ -13,15 +16,15 @@ const LikedHeader = () => { search-icon diff --git a/src/hooks/useQueryHooks/useComments.tsx b/src/hooks/useQueryHooks/useComments.tsx index 0eb0606..8d0db21 100644 --- a/src/hooks/useQueryHooks/useComments.tsx +++ b/src/hooks/useQueryHooks/useComments.tsx @@ -6,7 +6,7 @@ import { UseQueryResult, } from "@tanstack/react-query"; import { handleAddComment, fetchComments } from "../../methods/methods"; -import { AddCommentMutationProps } from "../../types/Types"; +import { AddCommentMutationProps, Comment } from "../../types/Types"; type UseCommentType = "query" | "mutation"; diff --git a/src/methods/methods.ts b/src/methods/methods.ts index 793e831..f8f50b9 100644 --- a/src/methods/methods.ts +++ b/src/methods/methods.ts @@ -82,6 +82,7 @@ export const handleAddComment = async ({ post, id: userid, }: AddCommentMutationProps): Promise => { + if (typeof userid === "undefined") throw new Error("You cannot provide uid of type undefined") const userdoc = doc(db, "users", userid); const dataSnap = await getDoc(userdoc); const dataset = dataSnap.data();