Skip to content

Commit

Permalink
change PortfolioImage by remiving await
Browse files Browse the repository at this point in the history
  • Loading branch information
HalynaRiabokonenko committed Feb 25, 2024
1 parent 6c88336 commit 922b306
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions my-app/src/Components/Portfolio/PortfolioImage/PortfolioImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,23 @@ import { ThemeContext } from "../../../providers/theme.tsx";
import { useContext } from "react";
import classnames from "classnames";
import { db } from "../../../../firebase-config";
import { doc, getDoc } from 'firebase/firestore';
import { doc, getDoc } from "firebase/firestore";
import { collection } from "firebase/firestore";



export const PortfolioImage = () => {
const { imageId } = useParams();


const docRef = doc(db, "photos", imageId)
const docSnap = await getDoc(docRef);
const docRef = doc(db, "photos", imageId);
const docSnap = getDoc(docRef);

if (docSnap.exists()) {
console.log("Document data:", docSnap.data());
} else {

console.log("No such document!");
}

// console.log("pho", docRef["url"])
// const photo = portfolioData.photos.find((el) => el.id === parseInt(imageId));
// const photo = docRef.
// console.log("phot", photo)
const { theme } = useContext(ThemeContext);



return (
<div
className={classnames(styles["portfolio-image__content"], styles[theme])}
Expand Down

0 comments on commit 922b306

Please sign in to comment.