From 3cede41dbe8c1f35367aa459f4ebdfafe60692a5 Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Mon, 13 Nov 2023 15:42:27 +0000 Subject: [PATCH] Change "books/books" to "movie/movies" --- src/App.js | 2 +- src/components/ItemImage.js | 2 +- src/pages/Home.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.js b/src/App.js index 3b802ff..690f1b5 100644 --- a/src/App.js +++ b/src/App.js @@ -118,7 +118,7 @@ const signIn = (email, password) => { // function to get data const readData = async () => { - const querySnapshot = await getDocs( collection(FBdb, "books") ) + const querySnapshot = await getDocs( collection(FBdb, "movies") ) let listdata = [] querySnapshot.forEach( (doc) => { let item = doc.data() diff --git a/src/components/ItemImage.js b/src/components/ItemImage.js index e0bb6f2..ba121ef 100644 --- a/src/components/ItemImage.js +++ b/src/components/ItemImage.js @@ -10,7 +10,7 @@ export function ItemImage ( props ) { useEffect( () => { if( props.source ) { - const imgref = ref( storage, `book_covers/${props.source}`) + const imgref = ref( storage, `movie_covers/${props.source}`) getDownloadURL( imgref ) .then( (url) => setImage(url) ) .catch( err => console.log(err) ) diff --git a/src/pages/Home.js b/src/pages/Home.js index fcf7bd5..04596cc 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -8,22 +8,22 @@ import { useState, useEffect, useContext } from "react" import { ItemImage } from "../components/ItemImage" export function Home(props) { - const [books,setBooks] = useState([]) + const [movies,setMovies] = useState([]) useEffect(() => { console.log( props.items ) - setBooks( props.items ) + setMovies( props.items ) }, [props.items]) - const ItemCards = books.map( ( book, itemkey ) => { + const ItemCards = movies.map( ( movie, itemkey ) => { return( - + - { book.title } + { movie.title }