Skip to content

Commit

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


Expand All @@ -14,12 +14,20 @@ export const PortfolioImage = () => {
const { imageId } = useParams();


const docRef = doc(db, `photos/${imageId}`)
console.log("bla", docRef)
const docRef = doc(db, "photos", imageId)
const docSnap = await 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)
// console.log("phot", photo)
const { theme } = useContext(ThemeContext);


Expand Down

0 comments on commit 6c88336

Please sign in to comment.