From 24a2093fc4041b819f91ec03037efd9cda6bfa70 Mon Sep 17 00:00:00 2001 From: Kevin Dev Date: Tue, 13 Jul 2021 23:40:53 -0600 Subject: [PATCH] added homepage and not found components, shop page added --- src/App.js | 24 +++++++++--------- src/components/home-page.jsx | 18 ++++++++++++++ src/components/not-found.jsx | 16 ++++++++++++ src/components/pages/shop/shop.jsx | 29 ++++++++++++++++++++++ src/components/pages/shop/shop.styles.scss | 29 ++++++++++++++++++++++ src/components/shared/layout.jsx | 18 ++++++++++++++ 6 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 src/components/home-page.jsx create mode 100644 src/components/not-found.jsx create mode 100644 src/components/pages/shop/shop.jsx create mode 100644 src/components/pages/shop/shop.styles.scss create mode 100644 src/components/shared/layout.jsx diff --git a/src/App.js b/src/App.js index 5935ef8..244e14a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,21 +1,21 @@ -import Header from './components/header/header' -import Hero from './components/hero/hero' -import MainSection from './components/main-section/main-section' -import FeaturedCollection from './components/featured-collection/featured-collection' -import Footer from './components/footer/footer' +import { Switch, Route } from 'react-router-dom' -import './App.scss'; +import HomePage from './components/home-page' +import NotFound from './components/not-found' +import Shop from './components/pages/shop/shop' + +import './App.scss' function App() { return (
-
- - - -
+ + + + +
- ); + ) } export default App; diff --git a/src/components/home-page.jsx b/src/components/home-page.jsx new file mode 100644 index 0000000..f4e067a --- /dev/null +++ b/src/components/home-page.jsx @@ -0,0 +1,18 @@ +import Layout from './shared/layout'; +import Hero from './hero/hero'; +import MainSection from './main-section/main-section'; +import FeaturedCollection from './featured-collection/featured-collection'; + +const HomePage = () => { + return ( + <> + + + + + + + ); +} + +export default HomePage; \ No newline at end of file diff --git a/src/components/not-found.jsx b/src/components/not-found.jsx new file mode 100644 index 0000000..4f3cd7d --- /dev/null +++ b/src/components/not-found.jsx @@ -0,0 +1,16 @@ +import Layout from './shared/layout'; + +const NotFound = () => { + const style = { + fontWeight: 'bold', + textAlign: 'center', + } + + return ( + +

Unfortunately we can't find that page

+
+ ); +} + +export default NotFound; \ No newline at end of file diff --git a/src/components/pages/shop/shop.jsx b/src/components/pages/shop/shop.jsx new file mode 100644 index 0000000..ef61f25 --- /dev/null +++ b/src/components/pages/shop/shop.jsx @@ -0,0 +1,29 @@ +import { useContext } from 'react' +import Layout from '../../shared/layout'; +import FeaturedProduct from '../../shared/featured-product'; +import { ProductsContext } from '../../../context/products-context'; + +import './shop.styles.scss'; + +const Shop = () => { + const { products } = useContext(ProductsContext); + + const allProducts = products.map(product => ( + + )); + + return ( + +
+

Shop

+
+ { + allProducts + } +
+
+
+ ); +} + +export default Shop; \ No newline at end of file diff --git a/src/components/pages/shop/shop.styles.scss b/src/components/pages/shop/shop.styles.scss new file mode 100644 index 0000000..a9ffca5 --- /dev/null +++ b/src/components/pages/shop/shop.styles.scss @@ -0,0 +1,29 @@ +.product-list-container { + margin: 3rem 0; + .product-list-title { + margin-top: 5rem; + text-align: center; + } + + .product-list { + div { + margin: 1rem; + cursor: pointer; + } + } +} + +@media(min-width: 800px) { + .product-list-container { + .product-list { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + margin: 0 5rem; + div { + flex: 0 0 190px; + } + } + } +} \ No newline at end of file diff --git a/src/components/shared/layout.jsx b/src/components/shared/layout.jsx new file mode 100644 index 0000000..aebf6b5 --- /dev/null +++ b/src/components/shared/layout.jsx @@ -0,0 +1,18 @@ +import Header from '../header/header'; +import Footer from '../footer/footer'; + +const Layout = ({ children }) => { + return ( + <> +
+
+ { + children + } +
+