E-Commerce Image site like picsum or Unsplash.
- Preview Image selection ,
- Favorite the image selection
- Add the images to cart.
- Upon Checkout, cart images are printed and shipped out to the customers
https://github.com/bobziroll/scrimba-react-bootcamp-images
- React Router - https://reacttraining.com/react-router/web/guides/quick-start
- PropTypes - https://reactjs.org/docs/typechecking-with-proptypes.html
Header.js
<header>
<Link to="/">
<h2>Pic Some</h2>
</Link>
<Link to="/cart">
<i className="ri-shopping-cart-line ri-fw ri-2x"></i>
</Link>
</header>
App.js
<Switch>
<Route exact path="/">
{" "}
<Photos />{" "}
</Route>
<Route path="/cart">
{" "}
<Cart />{" "}
</Route>
</Switch>
Set up the Context for our app.
- In a new file, create a new context with React
- In that same file, create a custom component that renders the Provider of the context you created
- For now, just pass in an empty string "" as the context provider's value prop
- Export the custom Provider component and the full context object (so we can pass it to the useContext hook eventually)
- Set up your index.js to use the custom context Provider you created. (You can wrap it as a parent of the Router component)
Add state to our context and pass it through the Provider
- Add state to hold the array of all photos our app gets from the API
- Pass the array of all photos through the value of the provider so it's available anywhere the app accesses the context