Skip to content

Esen karatas w3 react #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 252 commits into
base: main
Choose a base branch
from

Conversation

esenkaratas
Copy link

No description provided.

robvk and others added 19 commits April 13, 2023 13:22
Updated to State management instead of Context specific
Add rule to not allow code alongs
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.5 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.5...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.8...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
HackYourFuture#724)

Renamed homework to assignment, class to cohort and student to trainee
Bumps [express](https://github.com/expressjs/express) from 4.17.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.0 to 5.3.4.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
- [Commits](webpack/webpack-dev-middleware@v5.3.0...v5.3.4)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.10.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](mde/ejs@v3.1.6...v3.1.10)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@sycons sycons self-assigned this Feb 12, 2025
Copy link

@sycons sycons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following was implemented:

  • Copy over the assets folder to your ecommerce/src folder ✅
  • A context that stores the id of all of the favourites of the user (not the whole object) ✅
  • Heart clicked on product list page updates the favourites array in the context ✅
  • Favourites page listing the products user has favourited ✅
  • Navigation bar at the top that handles routing between / and /favourites
  • Create a useFetch custom hook to reuse logis for loading and error states ✅

Requested improvements:

  • Product details page loads when product is clicked on in home page. Currently it leads to an empty page.
  • Clicking on the heart should change it to the red filled heart and not lead to another page. See the demo app to see how it works: https://hyf-react-w3-example.netlify.app
  • Add route to product detail page
  • Deploy app somewhere (like netlify) and add link to PR

<Route path="/" element={<Products />} />
{/* Simplified route */}
<Route path="/favorites" element={<Favorites />} />
{/* Simplified route */}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add route to product detail page

const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);

useEffect(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useFetch hook can be used here

const [error, setError] = useState(null);
const [activeCategory, setActiveCategory] = useState("all");

useEffect(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useFetch hook can be used here

.finally(() => setLoading(false));
}, []);

useEffect(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useFetch hook can be used here

@esenkaratas
Copy link
Author

esensecommerceapp.netlify.app

Copy link

@sycons sycons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good. Thank you for making the changes.

I noticed running the app locally give this error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@vitejs/plugin-react'
This package isn't listed in package.json. It seems to have missed somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.