Change "books/books" to "movie/movies"

This commit is contained in:
Ray 2023-11-13 15:42:27 +00:00 committed by GitHub
parent bb31d1eca8
commit 3cede41dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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()

View File

@ -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) )

View File

@ -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(
<Col md={4}>
<Card key={itemkey}>
<ItemImage source={ book.cover_image} />
<ItemImage source={ movie.cover_image} />
<Card.Body>
<Card.Title>{ book.title }</Card.Title>
<Card.Title>{ movie.title }</Card.Title>
</Card.Body>
</Card>
</Col>