This is a solution to the E-commerce product page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- Switch the large product image by clicking on the small thumbnail images
- Users can see hover states for all interactive elements on the page
- Open a lightbox gallery by clicking on the large product image (needs to be added)
- Add items to the cart
- View the cart and remove items from it
- Semantic HTML5 markup
- CSS custom properties
- Mobile-first workflow
- React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. https://vitejs.dev/guide/
npm install react-bootstrap bootstrap
npm install yet-another-react-lightbox
-
npm install @reduxjs/toolkit
-
npm i react-redux
Vitest and React Testing Library
npm install --save-dev vitest
- add script => "test": "vitest"
npm install --save-dev jsdom
npm install --save-dev @testing-library/jest-dom @testing-library/react @testing-library/user-event
- add to vite.config =>
test: {
//add jsdom to vite
environment: 'jsdom',
//make all imports from Vitest global so that we don’t manually import in each test file
globals: true,
//include this setup test file
setupFiles: './src/tests/setup.jsx', // assuming the test folder is in the src of our project
}
- React folder structure
- React set global css
- Semantic html5 guide
- Carosel indicators
- React border component
- How to Customize the React Carousel Component
- Creating context
- Lightbox for Bootstrap 5
- Website - Mary P