From 9a2212f93edbe38cf81d9f1eaf593ec492fda4c2 Mon Sep 17 00:00:00 2001 From: reiyua Date: Sun, 14 Jan 2024 12:29:22 +0000 Subject: [PATCH] Move gallery from homepage to seperate page, create tempoary homepage --- src/App.js | 6 +++-- src/pages/Gallery.js | 41 ++++++++++++++++++++++++++++++++++ src/pages/Home.js | 53 ++++++++++++-------------------------------- 3 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/App.js b/src/App.js index 0579d66..9db1c9a 100644 --- a/src/App.js +++ b/src/App.js @@ -20,6 +20,7 @@ import { About } from "./pages/About" import { Home } from "./pages/Home" import { Contact } from "./pages/Contact" import { Detail } from "./pages/Detail"; +import { Gallery } from "./pages/Gallery"; // contexts import { StorageContext } from "./contexts/StorageContext"; @@ -92,16 +93,17 @@ function App() { } + // modify the navigation on line 101 to new home page (gallery is set for now) return (
- } /> + } /> } /> } /> } /> - } /> + } />
diff --git a/src/pages/Gallery.js b/src/pages/Gallery.js index e69de29..8e25189 100644 --- a/src/pages/Gallery.js +++ b/src/pages/Gallery.js @@ -0,0 +1,41 @@ +import Row from 'react-bootstrap/Row'; +import Col from 'react-bootstrap/Col'; +import Container from "react-bootstrap/Container"; +import Card from "react-bootstrap/Card"; +import { useState, useEffect } from "react" +import { ItemImage } from "../components/ItemImage" + +export function Gallery(props) { + const [artworks,setArtworks] = useState([]) + + useEffect(() => { + console.log( props.items ) + setArtworks( props.items ) + }, [props.items]) + + + + const ItemCards = artworks.map( ( artwork, itemkey ) => { + const itemLink = `/detail/${artwork.id}` + return( + + + + + + + { artwork.artwork_title } + + + + ) + }) + + return ( + + + {ItemCards} + + + ) + } diff --git a/src/pages/Home.js b/src/pages/Home.js index 65b1e9d..28fec9e 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -1,41 +1,16 @@ -import Row from 'react-bootstrap/Row'; -import Col from 'react-bootstrap/Col'; -import Container from "react-bootstrap/Container"; -import Card from "react-bootstrap/Card"; -import { useState, useEffect } from "react" -import { ItemImage } from "../components/ItemImage" +// DEVELOP HOME PAGE HERE + + +//import required modules +import { Container } from "react-bootstrap" + + export function Home(props) { - const [artworks,setArtworks] = useState([]) - - useEffect(() => { - console.log( props.items ) - setArtworks( props.items ) - }, [props.items]) - - - - const ItemCards = artworks.map( ( artwork, itemkey ) => { - const itemLink = `/detail/${artwork.id}` - return( - - - - - - - { artwork.artwork_title } - - - - ) - }) - - return ( - - - {ItemCards} - - - ) - } + return ( + // temp home page + +

This is a tempoary home page

+
+ ) +} \ No newline at end of file